-
-
Notifications
You must be signed in to change notification settings - Fork 790
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
Terminal output becomes garbled after doing imgcat on large images #879
Comments
Does this also happen with the nightly build? |
Also: |
Yes. There is nothing in the debug log:
Do I need to somehow increase verbosity? Btw, the output of the debug overlay is also unreadable, but copy pasting works anyway.
Doesn't help. |
I had an idea to look for errors in the system logs:
This:
Makes sense if 16k rgba texture is being requested with
Debian laptop running with
On this system GL_MAX_TEXTURE_SIZE is 8192, so it's no surprise that images larger than that fail, but there should be a check to avoid accidentally doing imgcat on such files. |
Thanks for digging in! Now that I know what to look for, I can think about addressing this. Meanwhile, I think you may be able to recover from this state by clearing the scrollback and then increasing and then decreasing the font size. |
OpenGL will silently let us allocate a texture larger than the GPU can bind to a sampler, reporting the error status out of band and leaving the display in a perma-broken state. This commit deliberately checks against the max texture size and raises an error in that case. The recovery story isn't perfect, but at least the texture remains usable, so the user can clear the screen and still be able to see glyphs afterwards. refs: #879
Rather than leaving the frame un-rendered, this commit arranges to make one last pass but with all image quad assignments skipped. This should at least make a reasonable effort at displaying text on the screen. refs: #879
I've pushed a couple of commits that should at least give you a mostly readable terminal in this situation. There may be more that could be done to make this more reasonable; for example, we could potentially scale the image if it is larger than the displayable screen, however, there are complications with this around animated formats (we'd have to scale every individual frame) and dealing with subsequent resizes (eg: if you make the window bigger, should we re-scale to fit?). |
Just tried it in nightly, works exactly as I expect. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Describe the bug
When I do
wezterm imgcat image.png
the terminal output in all the tabs becomes unreadable, screenshots:macos
linux
Environment
To Reproduce
# the image size seems to be depended on terminal and font sizes convert -size 20x8158 xc:white /tmp/image.png wezterm imgcat /tmp/image.png
Configuration
Can be reproduced with the default config / no config.
Here is a reduced one that has the bug on my system with the 20x8158 image:
The text was updated successfully, but these errors were encountered: