-
Notifications
You must be signed in to change notification settings - Fork 127
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
iterm2 terminal size not detected #44
Comments
Example of iterm2 build 3.4.8: The tiles seems strangely shrunken and the font is illegible. (DPI issue?) Even so, there should be more tiles because there is more space available. Note that the images also appear to have been shifted up by six pixels, truncating them at the top edge and adding extra space at the bottom. This appears to be a bug in iterm2 as it occurs when using |
Is there a workaround for this? |
Thanks for the reminder. I don't have a Mac, so it is tricky for me to figure out what is going wrong. My current guess is that iTerm2 is doing something funky with the DPI setting. Would you be willing to try setting |
Where do you want that to be set? As an environment variable? |
At the top of the lsix file. |
Problem is due to using a retina display and lsix is using With this preference set to "no" (defaults to "yes"), when given a sixel image, iTerm2 should show images from lsix at correct size.
I have a Mac mini with no retina display so I cannot test it myself, but it may be possible to detect whether the display is retina using the following sequence (from https://iterm2.com/documentation-escape-codes.html):
A non-retina display has output,
I expect the final attribute, "1.0" becomes "2.0" with a retina display. lsix can check for this and scale accordingly (assuming the user leaves this experimental feature to its default value of "yes"). |
Thanks for the detailed explanation. "Show inline images at retina resolutions" seems like a bad solution as it would mean sixel images would be larger but lower resolution for no good reason, right? The real problem is that I hardcoded the width of the tiles in lsix for simplicity. (For comparison, see the baroque image viewer, vv, which scales the image based on the resolution of the character cells.) It doesn't make sense to me that iTerm is returning "points" instead of pixels ever. I looked at the linked bug report, but it sounds like the issue got fixed for TIOCGWINSZ but not other methods. But then, I don't have a Macintosh, so there is probably something I don't know. I do know that TIOCGWINSZ is nice when available, which, unfortunately, is not always. It depends upon OS support. And, even for OSes that support it, can be filtered out depending upon how you are connecting to the machine. And, finally, being an ioctl, it cannot be used in a simple shell script, like It is true that XTWINOPS 14 ( Does XTWINOPS 16 ( And, final question, if you don't have a Retina display Mac, then does that mean lsix is giving you some other problem with the image sizes? |
I'm not sure it makes sense either, maybe we should file a bug report with iTerm2, to change this to pixels, George Nachman seems like a pretty nice guy. There are situations where TIOCGWINSZ is not available other than being a shell script.
iTerm2 does not support XTWINOPS
Happy to report that it is working fine on non-retina display! :) it has the same behavior whether the option is enabled or not, so I am very sure the users in this thread who report the issue are using a retina display like a macbook, or maybe a 4 or 5k display. I just stumbled onto this issue and looked into it a bit :) glad to help |
iterm2 does not detect terminal size, tiles are too small and too few per row.
The text was updated successfully, but these errors were encountered: