Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slow preview cleaning after quit #64

Open
NotMurPh opened this issue Aug 4, 2023 · 2 comments
Open

slow preview cleaning after quit #64

NotMurPh opened this issue Aug 4, 2023 · 2 comments

Comments

@NotMurPh
Copy link

NotMurPh commented Aug 4, 2023

hey so there is this issue that when you close lf using q keymap which defaults to quit, the preview lingers for too much time after the exit

video preview showcasing the problem :
https://i.imgur.com/2gBZaxg.mp4

some system information :
os : archlinux
ctpv version from aur(yay) : local/ctpv-git r257.930535c-1
lf config files : https://github.com/NotMurPh/DotFiles/tree/main/StarryNight/home/murphy/.config/lf
ctpv config files : https://github.com/NotMurPh/DotFiles/tree/main/StarryNight/home/murphy/.config/ctpv
zshrc file contaning lfcd : https://github.com/NotMurPh/DotFiles/blob/main/StarryNight/home/murphy/.config/zsh/.zshrc

i think what happens is that ctpv doesn't run its cleaner on-quit and it causes images to only get cleaned after ctpv fully closes i am currenlty using this work around in my lfrc

cmd on-quit ${{
	pkill ctpv
}}

i couldn't use ctpv -c $id because when on-quit runs it refreshes the lf which causes ctpv to redraw the preview so its basically useless here

thanks in advance for your time :)

@NikitaIvanovV
Copy link
Owner

ctpvquit checks if it needs to kill ctpv every second, hence the delay. I think I should change the frequency.

A more proper fix is to replace &ctpvquit $id with cmd on-quit $ctpv -e $id: it will use native lf on-quit command. The only problem is that it's supported only on lf >= r27.

@NotMurPh
Copy link
Author

NotMurPh commented Aug 11, 2023

A more proper fix is to replace &ctpvquit $id with cmd on-quit $ctpv -e $id: it will use native lf on-quit command.

ok so i've removed the &ctpvquit $id as you said and changed the

cmd on-quit ${{
	pkill ctpv
}}

to what you said cmd on-quit $ctpv -e $id but then i did some testing with this command :

while true ; do lf ; sleep 0.1 ; done and exiting manually right after

which turns out that if you get unlucky which i did in the second try while i was completely testing it manually at first, you could get stuck with a permanently lingering preview when i saw that i changed the line cmd on-quit $ctpv -e $id back to cmd on-quit $pkill ctpv and i couldn't get it to happen in my tests and looks like the ctpv -e method is sometimes like 1 in 15 times a tad slower which isn't important really

also if you remove &ctpvquit $id exiting the terminal causes the ctpv to stay open but the preview gets cleaned as it`s dependent on the terminal it self

nonetheless this issue isn't really important and already has a workaround for lf >= r27 as you said so feel free to close the issue if you want :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants