Closed yujinyuz closed 8 months ago
Images won't work on tmux as it doesn't support image protocols. However, this shouldn't just stall and should instead show a version of the image made up of colored text blocks. I'll try to reproduce on a mac later but you should avoid tmux altogether here.
@mfontanini Oh. Alright. I thought it was compatible with tmux since I can run kitten icat examples/doge.png
just fine within tmux.
Does this app not use that command under the hood?
Hmm interesting... kitty icat
may be skipping a step that the library this uses to print images uses, which may cause it to think tmux can't show images when it can. Under the hood this is running the same code that viu uses so this would need to be changed there.
Tmux actually supports sixel, now! https://www.arewesixelyet.com/#tmux (it has to be compiled in, though) Maybe that's what it's using?
I don't think that's the case here. I could be wrong but I think both tmux and your terminal emulator would need to support sixel and kitty (which @yujinyuz is using doesn't). The reason why this works on kitty icat
is because that uses some custom logic to deal with tmux. Because we use viuer
, this means that library would need to do the same.
Alright, this was fixed in #166 (only for the kitty terminal + tmux). See the notes there but tl;dr; you need to specify --image-protocol kitty-local
for now and gifs (I recently got these to work under kitty!) only work properly in the latest tmux 3.3a.
Hi @mfontanini I just tried this again with tmux 3.4 and kitty using presenterm 0.7.0
Passing the --image-protocol kitty-local
works but it doesn't render anything..
It works properly without tmux though..
I forgot to clarify (and forgot myself this was necessary so I had to chase it down): you need to enable the allow-passthrough
option in tmux (see man). e.g. put this in your tmux.conf:
set-option -g allow-passthrough on
This allows tmux to pass through characters straight to the terminal emulator so it handles them rather than tmux doing so itself. In this case, this lets presenterm tell tmux that the escape codes to transmit images via the kitty protocol need to be forwarded to kitty, as it's the one drawing them.
Awesome! That makes sense now.
It’s working properly now.
The only problem I see is that if you didn't pass the image-protocol
, it just hangs and doesn't load.
But I can live with this and I just changed the default config.yaml.
Yeah I know, it's not great but I haven't spent the time to figure out how to do this properly without risking doing something wrong. At least the config file approach does it for now.
Even with all the settings above, iterm2 still cannot produce the image with tmux ;(
Tmux version: 3.4 presenterm: latest code build command: presenterm test.md --image-protocol iterm2
Are you using large image files? Does it also fail if you use a small image? e.g. a few KBs long
Hi, I tested 1KB image. It still doesn't work.
I tried downloading the binary in the releases and also tried building it but still had the same problem.
The terminal just hangs whenever it's the image part and could not proceed further through the slides.
https://github.com/mfontanini/presenterm/assets/10972027/63e40205-9797-4fa7-8ac5-eee0f0dbedc3
I tried running without tmux and it was working just fine.