arakiken / mlterm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug? corruption during (lots of) 24-bit ANSI escape codes

patsie75 opened this issue · comments

I'm not very familliar with mlterm and only recently installed it to check compatibility with my awk-scripts, which output a lot of ANSI escape codes for 24-bit colors (i.e.: ESC[38;2;(r);(g);(b);48;2;(r);(g);(b)m )
These escape codes seem to cause semi-random corruption in mlterm's output.
An example can be found here: https://youtu.be/rXlc66Ymz_I
When outputting the same ANSI encoded content/file multiple times, the corruption seems to be semi-randomly displayed every time. The above video shows this by 'zcat' the same file multiple times in mlterm.

The used file (demo.frame.gz) with the ANSI encoded content, is attached to this bug-report.
demo.frame.gz

Please advise.

Any feedback at all is appreciated

Thanks.
Sorry for replying late.
I fixed it -> 036c7f0

Even if you apply this patch, the screen gets corrupt if you select it with the mouse.
If you also want to fix this problem, specify --disable-compact-truecolor option to ./configure script in building mlterm.

Regards,

No need to apologize, I'm happy that you are so active in working on this project! Thank you a lot.
Indeed the corruption is now gone. So that is good news! Thank you for that!

I did notice that because of your 'compact' use of true color, the color accuracy is less than optimal. See this screenshot for example with four different terminals and the output of the same program (awk-demo) at a similar point in time.
Screenshot from 2022-04-03 14-56-57-1
The top-left terminal is standard compiled mlterm from the latest master branch (with your fix) Here you can clearly see color-banding happening, but performance is good.
The top-right is mlterm master branch compiled with --disable-compact-truecolor. The color-banding is now gone and it looks color-accurate! The only issue is that performance of displaying large amounts of (true-color) ANSI escape codes has dropped dramatically. Sometimes more than 50%.
The bottom-left is Gnome Terminal (libvte based) and the bottom-right xterm. Both look color accurate and have great performance.

Thanks.
"--vtcolor true" option improves accuracy.
I'll investigate the performance problem.

Running mlterm with --vtcolor true really did the trick! color accuracy looks great and performance is 'good enough'. Mlterm is not as fast as Gnome Terminal or xterm, but it has a reasonable throughput (at least for my usecase :-) )
(Just in case you are interested in my usecase(s), you could try for example https://github.com/patsie75/awk-demo )
For now I will consider this report closed (the color bug has been solved). If you could squeeze some extra performance out of mlterm, I would love it, but won't blame you if have other priorities.

Thanks again for the help!