gokcehan / lf

Terminal file manager
MIT License
7.6k stars 321 forks source link

how to restart lf to reset ueberzug #1556

Open lucas-mior opened 8 months ago

lucas-mior commented 8 months ago

Sometimes image previews using ueberzug stop working and I need to restart lf to make them work again. I have been unable to write a command to spawn a new lf with the same environment and quit the original session. What I have tried:

# `lfimg` is the script to setup ueberzug and launch lf

# this works but the old session is still there
cmd restartlf ${{
    lfimg
}}
# this only quits lf without spawning a new one  (the error is "initializing screen: open /dev/tty: no such device or address")
cmd restartlf ${{
    setsid -f lfimg
    lf -remote "send $id quit"
}}

I now that I should probably debug ueberzug, but this bug is hard to reproduce.

cv1618 commented 7 months ago

Sounds like there's not good things going on in this lfimg script lol. For previews I use this guys scripts and tutorial. https://github.com/thimc/lfimg