NikitaIvanovV / ctpv

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

`forcekitty` option does not seem to work for me #26

Closed otaj closed 1 year ago

otaj commented 1 year ago

Hi,

I was trying to make use of your program, however, it seems, that set forcekitty option does not work for me.

I am running Arch, package ctpv-git (installed today, 2022-12-09), kitty version 0.26.5. Kitty method of showing images by itself work (kitty +kitten icat img as well as alias icat img), however, when I don't have any other image previewer installed, ctpv img prints binary garbage at me.

At first, I thought the issue might be ctpv not picking up my config, maybe I put it into wrong location, however, I did a simple test to rule this out - installed chafa, ctpv img started showing images (as it should) and then I changed a line in my config to set noimages and was back to binary garbage - as expected given chafa exists on the system.

Thank you very much for otherwise awesome previewer, it would be great if I was able to make it work.

Btw, I'm running on sway, so ueberzug is not an option, since I'm a full time Wayland resident

NikitaIvanovV commented 1 year ago

I have the same version of kitty and it works on my machine. Could you please save this script to some file and run with sh file.sh?

is_kitty() {
    case "$TERM" in
        *-kitty) return 0 ;;
        *)       return 1 ;;
    esac
}

is_kitty
echo $?
echo $TERM
otaj commented 1 year ago

Ha, that was it! For some weird reason I had line export TERM=xterm-256color in my .zshrc that I was carrying over from different setups. Now that I deleted this line, everything works. Thanks a lot!