gokcehan / lf

Terminal file manager
MIT License
7.8k stars 330 forks source link

Previewer script stealing focus resulting in lf hanging #1696

Open avidseeker opened 7 months ago

avidseeker commented 7 months ago

In a previewer script, use the following previewer for zipped files:

atool -l

Then try previewing an encrypted zip or 7z file. Since atool -l prompts for a password, it will wait for that password to be input and the result is lf hanging. The way scripts like ranger scope.sh avoid this is by providing an empty password like this:

        rar)
            ## Avoid password prompt by providing empty password
            unrar lt -p- -- "${FILE_PATH}" && exit 5
            exit 1;;
        7z)
            ## Avoid password prompt by providing empty password
            7z l -p -- "${FILE_PATH}" && exit 5
            exit 1;;

Despite this, I don't think it is the right behavior for a previewer to read input, and lf shouldn't hang when a previewer requests user interaction.

og900aero commented 7 months ago

The best solution would be if lf could redirect these requests to their own interface, or open a TUI window for this separately (like yazi) where they would request the data. This would solve several problems (such as sudo). I would really like to see this further developed.

saram-aman commented 7 months ago

@avidseeker please assign the task to me!