kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.4k stars 150 forks source link

the preview process will not be interrupted after exiting joshuto #353

Open Urie96 opened 1 year ago

Urie96 commented 1 year ago

Is it possible to interrupt the previous preview process after switching the preview file

DLFW commented 1 year ago

Question and title are contradicting. Is it about exiting Joshuto or about moving the cursor to another file?

In the first case, I would also expect the preview process to get stopped. In the latter case, it's a design question....

kamiyaa commented 1 year ago

Imo, it makes sense to keep the preview process running so when you navigate back to that file, its preview is already loaded. But it does pose some performance issues if too many processes are initiated.

Maybe theres a compromise by having some sort of a queue/thread pool system. Then we can set limits on how many preview processes is active at any given time, and how many previews can be queued up.

DLFW commented 1 year ago

Maybe theres a compromise by having some sort of a queue/thread pool system.

I think that would actually be right solution. Just that this queue must be “LIFO”, not “FIFO”, because the most important file to generate a preview for is the current one. If we would have something like that, it would be great to queue all files for a directory when entering it. (At least as an option.) That would boost the “responsiveness” of the preview greatly.