Skip to content
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

tmux built with sixel support not working as expected in wsltty #344

Open
a-priestley opened this issue Nov 24, 2023 · 10 comments
Open

tmux built with sixel support not working as expected in wsltty #344

a-priestley opened this issue Nov 24, 2023 · 10 comments

Comments

@a-priestley
Copy link

I don't know if this is an issue with tmux, or wsltty, but I've gathered some curious results on different combinations of terminal emulators, with / without tmux:

foot run with wslg, no tmux:
image

wsltty, no tmux:
image

foot run with wslg, tmux:
image

wsltty, tmux:
image

It seems that the addition of tmux to wsltty is preventing sixel support.
I have wsltty installed via scoop, with the following configuration:

# To use common configuration in %APPDATA%\mintty, simply remove this file
Scrollbar=none
Font=FiraCode Nerd Font
Term=xterm-256color
FontHeight=14
CtrlShiftShortcuts=yes
CursorType=block
@mintty
Copy link
Owner

mintty commented Nov 24, 2023

I've built latest tmux on cygwin and it does not work either (no WSL involved).

@Biswa96
Copy link
Contributor

Biswa96 commented Nov 25, 2023

Is it tmux in cygwin or tmux in wsl?

@a-priestley
Copy link
Author

Is it tmux in cygwin or tmux in wsl?

In my situation? Just wsl. Identical environment, but accessed from two different terminal emulators.

@a-priestley
Copy link
Author

Something else I just discovered is that sixels will not work in nested tmux sessions (inside foot) either -- the same thing happens.
I wonder if the cause for this and the one for the issue above are one in the same?
If so, I should probably take this issue over to https://github.com/tmux/tmux.

@mintty
Copy link
Owner

mintty commented Nov 25, 2023

foot run with wslg, tmux:

What does this mean? What is wslg? How do you produce sixel in WSL?

@a-priestley
Copy link
Author

foot run with wslg, tmux:

What does this mean? What is wslg? How do you produce sixel in WSL?

wslg, or "wsl gui" exposes a display server from the subsystem with which to serve up graphical applications viewable from your normal windows display session. Typically you'd use it to run actual gui apps, like gimp for example, and simply use windows terminal for your terminal needs. But since windows terminal does not support sixels, I used foot, exposed through wslg to confirm that I am, in some capacity, able to render sixels in a tmux session from wsl.

@mintty
Copy link
Owner

mintty commented Feb 18, 2024

I could meanwhile reproduce this weird effect.
However, it works with tmux in cygwin and it works without tmux in WSL.
So I doubt it's a mintty/wsltty issue. Please report to tmux.

@JCallicoat
Copy link

tmux is looking for a non-standard terminfo flag called Sxl to determine if the terminal supports sixel (see manpage source here). If it doesn't find that flag in terminfo for $TERM it writes the "SIXEL IMAGE ..." text placeholder as a fallback (see here). I think adding something like this to your tmux.conf will force it to enable sixel images regardless of terminfo (after exiting all tmux sessions and restarting tmux).

set -as terminal-overrides ',*:Sxl' # sixel support

@mintty
Copy link
Owner

mintty commented Feb 28, 2024

There is no such flag in my cygwin environment and it works anyway.
Setting the flag in WSL does not work either. Both with tmux 3.5.

@JCallicoat
Copy link

tmux also has to be built with the --enable-sixel configure option. I'm not super familiar with it, I have just recently been trying to get sixel to work in various terminal emulators with tmux with varying degrees of success. But even setting an override like that (or compiling my own terminfo entry with the flag added outside of tmux) doesn't work in some terminal emulators that show sixel images fine outside of tmux, so there must be some other secret sauce or a tmux issue. But I came across this issue when searching around for solutions and just thought it might be useful to share where I found the "SIXEL IMAGE" placeholder text comes from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants