NikitaIvanovV / ctpv

Image previews for lf file manager
https://www.nikitaivanov.com/man1/ctpv
MIT License
264 stars 23 forks source link

Image previews stopped working in a recent update #70

Open musjj opened 1 year ago

musjj commented 1 year ago

In a recent NixOS update, for some reason image previews stopped working. I'm using kitty 0.29.2

This is my config:

set previewer /nix/store/m7xbhvr4qcvl7na07644rqb5j2vsrj4l-ctpv-1.1/bin/ctpv
set cleaner /nix/store/m7xbhvr4qcvl7na07644rqb5j2vsrj4l-ctpv-1.1/bin/ctpvclear
cmd on-quit %/nix/store/m7xbhvr4qcvl7na07644rqb5j2vsrj4l-ctpv-1.1/bin/ctpv -e $id
&/nix/store/m7xbhvr4qcvl7na07644rqb5j2vsrj4l-ctpv-1.1/bin/ctpv -s $id

Running ctpv image.jpg by itself properly renders the image into the terminal.

Strangely, if I remove the final ctpv -s $id line from my config, previews in lf now works. What is this command for? It seems that it acts as a server, but preview works anyways without it.

EDIT: Hmm, it seems that the server is only needed for ueberzug, which I don't use (https://github.com/NikitaIvanovV/ctpv/issues/12#issuecomment-1233167315). So I guess I can just safely remove that line. Still don't know why it stopped working though.

NikitaIvanovV commented 1 year ago

Yes, currently ctpv -s $id is only needed for ueberzug. My guess is that ctpv thought ueberzug was available on your system but it did not work for some reason, resulting in no preview being shown. Do you have ueberzug installed? If yes, does bringing back the deleted line and adding set forcekitty to your ctpv config fix the issue?

te-lang-wakker commented 7 months ago

This is the config that works for me on NixOS with Kitty:

set previewer ctpv -s $id
set cleaner ctpvclear
cmd on-quit ctpv -e $id

These are my relevant installed packages:

lf
ctpv
file
poppler_utils
atool
ffmpeg
colordiff
fontforge
elinks
jq
libreoffice
imagemagick
ffmpegthumbnailer
mdcat

Do note that you need file for any of these to work at all. At least, I did.