ytfzf
ytfzf copied to clipboard
Thumbnails non-functional in Wayland using normal terminal emulators
Thumbnails do not display in Wayland using a normal terminal emulator due to ueberzug relying on X. This is obviously an upstream issue but something I feel is worth mentioning. For example gnome-terminal does not work.
I tested in kittyhowever, which has its own image protocol and it does work, but in 99% of terminals it will likely not work by default.
We are using ueberzug for image previews. Ueberzug doesn't work well with wayland. We will need to look for other terminal viewers.
I did a little bit of testing on this. It works on X11 based terminal emulators such as urxvt. Wayland based ones such as terminator don't work. Which has definitely to do with ueberzug being X11 based. Adding an additional option for us Wayland users would be appreciated. PS: @littlediobolic i didn't got it to work with kitty, how did you do that? It's a wayland native app so it shouldn't work, since ytfzf only supports ueberzug and not kittys own protocol.
@SamsiFPV Terminator is not Wayland based, and thumbnails works very well in Terminator on X11.
@napcok wrong wording form my side, i meant it runs in wayland natively. My bad.
How about we use an external viewer? I was able to make it work with sxiv (any viewer that auto updates when the file changes) . The only caveat is that it wouldn't look great since you have 2 windows, one with names and the other with thumbnails.
maybe a pretext to re-invent ueberzug but for wayland? could be useful for tons of things
PS: @littlediobolic i didn't got it to work with kitty, how did you do that? It's a wayland native app so it shouldn't work, since ytfzf only supports ueberzug and not kittys own protocol.
@SamsiFPV I did not do anything special to get it working. I just downloaded kitty, ran it, and thumbnails displayed properly. I can send logs if necessary but I am unsure what caused it to work.
I would recommend looking at kitty https://sw.kovidgoyal.net/kitty/graphics-protocol.html
What about sixel?
I tried img2sixel and lsix both didnt work but the problem is that fzf interprates input itself and doesnt let the terminal interprate the input, so sixel and anything that draws the image on the terminal itself wont work, w3m could work but the image does not stay on the screen.
Try chafa
#254 adds a few different methods for viewing thumbnails, chafa is one of them, it has been accepted into the development branch, so if you clone the development branch and run ytfzf --thumb-disp-method=chafa
it should use chafa for displaying thumbnails (it is a bit laggy but not as laggy as catimg)
I also will probably keep trying to implement w3m since it's a proper image viewer
would love sixel support so I can use in sway, with 'foot'. Ranger works well with a sixel patch. Tried chafa, it works, but looks a bit rubbish. Hope sixel gets supported.
sixel just does not work in fzf, it ends up displaying the actual characters (yes I tried in a terminal that supports sixel).
Shame. Guess I'll use chafa then, and squint a bit. :)
Haha, chafa imo is actually decent but not as good as true image viewers ofc. w3m's image viewer might work with fzf but it seems to not stay on the screen for very long.
Doesn't work on nixos
in foot
terminal even with this flag
ytfzf --thumb-disp-method=chafa
@timsofteng you also need --show-thumbnails
@timsofteng you also need
--show-thumbnails
Thanks!
Yes, it works with ansi format.
P.s is it limitation of fzf? Images in terminal is a big pain... Tmux doesn't suppor sixel as wel...
is it limitation of fzf
yes
Was anyone able to get it to work with Kitty's icat?
Did some testing with w3m, learned it's protocol to understand what is happening with this command
printf "%b\n%s\;\n%s\n" "0;1;$x;$y;$width;$height;;;;;$image" 3 4 | w3mimgdispaly
here's the docs (yes this is all i could find)
Basically what I think is happening is, w3m is drawing the image THEN fzf is drawing the preview window, however i also tried using skim and it had the exact same issue.
If anyone knows an fzf alternative/fork that includes the --preview flag I can try it.
My solution to this is to put that line of code in a while true loop so that w3m is always drawn ontop of the preview window, this is a very bad solution, but it works.
w3m image support has been merged into the rewrite, I wasn't able to find a better way to do it though.
@Euro20179 Isn't w3m-img X11 specific?
@VarLad Damn, didn't realize that, tested it on say, yes it's x11 specific. If you can't get thumbnails on wayland with w3m i'm not sure how you can, so this will remain open for the foreseeable future.
@Euro20179 Can you try out kitty's icat? https://github.com/kovidgoyal/kitty/issues/2238
I have no idea why I just realized this now, but when i tested w3m on wayland, i tested it in alacritty, in which w3m doesn't work at all, retested it in sway with xterm, and yes w3m works.
TLDR: messed up my testing in wayland, w3m does work in wayland.
@Euro20179 Its because XTerm runs on XWayland. ueberzug
works that way too
That runs with Wezterm with Wayland disabled too (which means its using XWayland)
I was not using XWayland, i ran sway by itself. And to test, i logged into another tty, and launched sway from there. w3m worked, ueberzug did not.
Thumbnails do not display in Wayland using a normal terminal emulator due to ueberzug relying on X. This is obviously an upstream issue but something I feel is worth mentioning. For example gnome-terminal does not work.
I tested in kittyhowever, which has its own image protocol and it does work, but in 99% of terminals it will likely not work by default.
how did you get images showing with kitty, it is my main terminal and I don't get pictures.