New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect/glitchy sixel output, and crash on high sixel image count #905
Comments
Thanks for the detailed description, I'll try to reproduce, but let me comment already now that the fact that
is a bad idea which I'd call a design flaw of Jexer. |
I see the flickering but I couldn't get the terminal to crash, or the server to stall. |
Tracing mintty, jexer apparently splits up the image but not into cell-sized parts. It uses 1 sixel image per ~7 cells. This is weird. Why does it split up at all when there is no overlap? |
It's working OK in xterm, mlterm, and yaft, and also enables me to use sixel output for font rendering (double-width/height, CJK, and emoji).
If sixel images overlap each other or text cells, it can result in a corrupted display. More specifically, the text will always appear where and how it should be, but the image might leave artifacts in the region it was originally drawn in. I haven't dug deep into xterm to determine if that is a bug that should be fixed or not, instead I developed a different strategy that (I hope) should work on any terminal with sixel support:
With the above points, I never require an image to maintain some kind of coherence after text has overwritten it, and I never draw overlapping images. (At least I shouldn't, if I do that is a bug.) |
Also: my cygwin test environment is a 32-bit VM running Win 7 ( enterprise, I think)? |
Ah, so you are the jexer owner. Some jexer observations: Some mintty observations: |
Thank you, I'll add an issue for it.
0.3.2 is only using CSI 14 t. Git head is now using both CSI 14 t and CSI 16 t, and the 16 t response will win out. |
You should also use |
I already have the text size from either 'stty size' (stdin/stdout) or telnet NAWS option. I just need to relate that to pixels to get font size, so that I can know how many cells will be covered by the image. But I suppose I could also ask for 18 t as a fallback to compare to stty. |
stty seems a heavyweight approach to get rows and cols, and telnet can return
Usage is:
e.g.
|
Jexer has an explicit design goal not to call C functions directly, so that it can be referenced for or ported to languages with poor C FFI. I started writing another technical bit about the how/why in answer here, but realized that it would be an even better addition to the Jexer porting wiki page . So thank you both for a productive writing session this morning. :) I've also included the tip on "CSI 8 t" there. |
As you noticed and also described in https://gitlab.freedesktop.org/terminal-wg/specifications/issues/12#note_218071, the mintty image rendering mechanism is currently not prepared to digest such dynamic usage of sixel output. Particularly, images that get overwritten completely are still maintained AND displayed - just overwritten afterwards. That may be the cause of the flickering. |
After fixing one serious bug and optimising sixel rendering for completely overlapped images (which are now removed), I hope this issue is fixed. |
Released 3.0.3. |
Steps to reproduce:
Install cygwin + inetutils + Oracle JDK at version 1.6 or above.
Download jexer-0.3.2.jar from https://jexer.sourceforge.io, or install ant and build it (git clone https://gitlab.com/klamonte/jexer ; cd jexer ; ant jar).
Since the Jexer xterm backend can't spawn "/bin/sh -c stty" from the Win32/64 java.exe, you must use the telnet server demo. Run 'java -cp jexer-0.3.2.jar jexer.demos.Demo2 4444'.
Open another mintty window, 'telnet localhost 4444'
In the Jexer demo application, select the tools (hamburger) menu on far left, and navigate on the left directory treeview to a directory with an image. Double-click the image filename on the right files list.
The image might be scaled incorrectly due to window manipulation issues #899. Regardless, drag the window with the image down a bit.
At this point, the image flickers/stutters within the image window. Issue Internationalisation #1.
Exit the demo, either with Alt-X or selecting the File | Exit menu item. Click on Yes to exit.
Repeat the 'telnet localhost 4444'. mintty crashes with a stackdump. If using a mintty window for both the 'java -cp jexer.jar' (step Better transparency #3) and the telnet (step Don't keep cmd.exe window open #4/Add option to remove the title bar #7), both windows are unusable. Issue Documentation #2.
The telnet.exe process may also still be running in the background, using 100% CPU.
Further details:
Jexer's sixel output is outlined roughly here. Jexer uses many small sixel images to compose a larger picture, and defaults to 1024 colors. (And if you have run into any other terminal multiplexers / windowing toolkits with overlapping image support, I would love to try them out...)
The text was updated successfully, but these errors were encountered: