hzeller / timg

A terminal image and video viewer.
GNU General Public License v2.0
1.91k stars 73 forks source link

tmux passthrough for other terminals #125

Open ErrorNoInternet opened 8 months ago

ErrorNoInternet commented 8 months ago

Does timg support tmux passthrough for terminals other than Kitty? It doesn't seem to be printing anything when using it in foot + tmux

image

Top is tmux + yazi, middle is tmux + timg, and bottom is timg without tmux Foot only supports sixel (my timg is aliased to timg -ps)

https://github.com/sxyazi/yazi seems to support it, but I had to manually enable tmux passthrough (https://github.com/sxyazi/yazi/wiki/Image-preview-within-tmux)

hzeller commented 7 months ago

Unfortunately, tmux does not allow pass-through of image protocols. I think tmux folks want to keep things simple and avoid strange corner-cases.

The only reason it works for Kitty is some trickery, which works only really with kitty...

If you want image protocols supported in tmux, ask the developers there (but I think others tried to ask before).

ErrorNoInternet commented 7 months ago

https://github.com/hzeller/timg/assets/61157623/1c34e9b0-ec9f-4dc7-b816-46543d72a2a6

I got it to work by sending a few special escape sequences that https://github.com/sxyazi/yazi also sends (specifically the code in https://github.com/sxyazi/yazi/tree/main/yazi-adaptor/src), it's just that the image height isn't properly being realized by the terminal, so it cuts off things that it wasn't supposed to cut.

hzeller commented 7 months ago

Interesting, so there are 'workaround sequences'. I'll re-open and will have a look when time permits.