-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
sixel inside tmux and ssh workaround #17815
Comments
Huh. That's super bizarre. Our best guess right now is that it's the same thing as #17813, but we'll leave this open for now to make sure we check this too. Thanks for filing! |
As far I can recall, tmux relies on a Obviously that's not going to work on Windows because we aren't a Linux app. I'm assuming WSL generates the character dimensions itself by using one of the win32 console APIs to monitor the console buffer size, but it can't know the pixel size, so it leaves those values as 0x0. This is actually not that uncommon a situation, because the pixel fields are not really standard AFAIK, and not all terminals fill them in. And when it comes to a remote connection to Linux, it's up to ssh to pass the window dimensions to the remote server, but the WSL version of ssh would itself depend on the local So why does it work when you ssh from Windows to WSL? That's the bit that was a surprise to me, so I just checked, and it seems that the Windows version of ssh just fakes the pixel dimensions - they're hardcoded to 640x480 regardless of the terminal size. This should be enough to get tmux to work, but I would expect images to be misshapen unless the terminal was exactly 64 columns by 24 rows. I don't have a recent copy of tmux, though, so I haven't actually tested that. As for fixing this, I don't think there's anything we can do about it. It could be fixed by tmux if they used one of the |
That's true: if the window size is larger than ~24 rows, there is a big black area. Also, if I fake xpixel and ypixel values in |
Closing this as the patch suggested by @j4james in the last comment here was accepted to tmux (89adec0ca5) |
@galchinsky Thank you for doing the work to get this fixed in tmux. It's much appreciated. |
Windows Terminal version
1.22.240823002-preview
Windows build number
10.0.22631.4037
Other Software
tmux next 3.5 (latest so far 34807388b064 commit built with --enable-sixel)
Steps to reproduce
In WSL2 tab
img2sixel logo.png
just works, hurray. It also works if I ssh to a remote server from the WSL2 tab.Then I start tmux and run the same command. It outputs in a fallback mode
Then I (similarly to a suggestion at wez/wezterm#1236)
sixel output starts to work, even on a remote server + tmux combination. This is weird, because if it wasn't so, I would think it's a tmux bug. But now it seems something is off with how WSL2 tab works.
Expected Behavior
sixel output inside tmux
Actual Behavior
tmux outputs
SIXEL IMAGE (12x6)
++++++++++++
++++++++++++
++++++++++++
++++++++++++
++++++++++++
but works correctly if ssh to WSL2 from Windows
The text was updated successfully, but these errors were encountered: