NikitaIvanovV / ctpv

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

Command "cmd on-quit" doesn't work #7

Closed hikkidev closed 2 years ago

hikkidev commented 2 years ago

Bug: https://mega.nz/file/BNMkULpZ#CkmpOk7YKSsn6PU84T5RisuUouUHp53b2Uzat83cPyw

You should remove the cmd prefix for the new version of lf (r27), otherwise the command will not work

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

You should also update the documentation in lf -> https://github.com/gokcehan/lf/wiki/Previews#with-stpv-and-ctpv

System kitty: version 0.25.2 created by Kovid Goyal lf: version r27 OS: Arch Linux x86_64 5.18.10-zen1-1-zen WM: sway v1.7

NikitaIvanovV commented 2 years ago

I've updated lf on my machine and everything works correctly. I also couldn't find a commit where they made it so that you don't need cmd prefix to define the on-quit command. Do you use Kitty terminal? Please send your kitty terminal and lf versions.

kitty -v
lf -version
hikkidev commented 2 years ago

Please send your kitty terminal and lf versions.

I've already attached this information above, in the system section.

hikkidev commented 2 years ago

Well, just watch this: https://mega.nz/file/9NUz1LbT#TyJF6xHQjkn8n3iSrUtQE8Ar8rkfgIc_LCd_goksw9g

NikitaIvanovV commented 2 years ago

I've already attached this information above, in the system section.

Yeah, I'm sorry, to some reason I didn't notice that.

It was me who requested the addition of on-quit command to fix the problem you're experiencing. It was added but it's not a part of the latest release yet.

Please try installing lf-git AUR package and see if the problem is fixed.

hikkidev commented 2 years ago

No, the same results image

hikkidev commented 2 years ago

Configs

❯ cat .config/lf/lfrc

set shell sh
set shellopts '-eu'
set ifs "\n"

set scrolloff 10

set icons

# Terminal previewer
set preview true
set previewer ctpv
set cleaner ctpvclear
&ctpv -s $id
cmd on-quit $ctpv -e $id
❯ cat .config/kitty/kitty.conf
font_family      MesloLGS NF
bold_font        auto
italic_font      auto
bold_italic_font auto

font_size 14.0

adjust_line_height  0
adjust_column_width 0

background_opacity 0.85
hikkidev commented 2 years ago

I guess cmd on-quit functionality is not yet included in lf so I just removed that prefix and the ctpvclear call always happens ¯\(ツ)

NikitaIvanovV commented 2 years ago

It turns out that there is a minor bug in lf where it runs a previewer on quit if cmd on-quit is set. I've pushed some changes that should work around the issue, it's not ideal but should work for the time being. Could you please update ctpv-git and test it?

hikkidev commented 2 years ago

Huh image

hikkidev commented 2 years ago

I've pushed some changes that should work around the issue, it's not ideal but should work for the time being.

Yeah, it's strange :) Record: https://mega.nz/file/pUsDnKha#R-HwPwOXOqt7uvRwwcFMEaRyXKZzS24DNhP2u5ysJd0

NikitaIvanovV commented 2 years ago

Yeah, it's strange :) Record: https://mega.nz/file/pUsDnKha#R-HwPwOXOqt7uvRwwcFMEaRyXKZzS24DNhP2u5ysJd0

Yeah, the image appears for a second after quitting lf, this is what I called not an idean solution. If you do not use Ueberzug or Chafa to view images (only Kitty terminal), I think you can comment out cmd on-quit line in your lfrc if the flickering image bothers you.

NikitaIvanovV commented 2 years ago

Huh image

What happens if you run gpg --recv-keys 6E656AC5B97B5133?

hikkidev commented 2 years ago

Oh, never mind. This problem is caused by an empty /etc/resolv.conf (systemd-resolved). Solved by adding nameserver 1.1.1.1 # Cloudflare.

image