mintty / wsltty

Mintty as a terminal for Bash on Ubuntu on Windows / WSL
Other
3.11k stars 104 forks source link

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

Open a-priestley opened 1 year ago

a-priestley commented 1 year ago

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 commented 1 year ago

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

Biswa96 commented 1 year ago

Is it tmux in cygwin or tmux in wsl?

a-priestley commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

foot run with wslg, tmux:

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

a-priestley commented 1 year ago

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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.