mistakenelf / fm

A terminal based file manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fm hangs when navigating to folder with vast amount of files

mrusme opened this issue · comments

When I open my downloads folder (which contains half the internet of files of all sorts of types) fm simply hangs and won't let me do anything. Even Ctrl+C hangs.

The folder cointains approx 857 files, many of which are images, pdfs and zips.

It looks like it's due to the file size calculation. If I just let it stand for a while fm will eventually become responsive again. Is there a way to ....

  • disable the size column, either through a shortcut or through configuration
  • run the size calculation in a separate thread so it won't block the rest of the UI
    ?

Oh snap, changing the dir and going back results in a full re-calculation of the sizes.

Would it be possible to cache the values?

I'm not quite certain why this takes that much time however. A simple ls -la in that directory completes in 0.03s using exa and also displays the file sizes.

I had noticed this as well actually with a node_modules directory. Will look at adding a config to disable the size calculation. It runs in separate go routines but for some reason hangs when there is a lot of directories and files. The size calculation is recursively going through directories and calculating the size of all the files in there which ls does not do. That being said I plan to look into why this happens

@mrusme just released 0.13.4 which adds a config value for calculated_file_sizes which by default will be false. Going to look into why the UI freezes up on large directories with calculated file sizes on

Just upgraded, works perfectly smooth, thanks! File sizes for files show up instantly and no UI hangs to be noticed.