fff
fff copied to clipboard
show file size mode
The new "show file size" mode added. This mode shows file sizes (when available) on the right and it switched on by default. Mode may be toggled by "z" key and may be switch off by default by setting "export FFF_SHOW_FSIZE=0" environment variable
All done in https://github.com/dylanaraps/fff/pull/72/commits/a2b28c21018d16d7bbbfd64d766ecc2bf9229ae6
The main problem with this PR is the performance impact. This adds significant delay to fff
. If I hold down a scroll key it takes seconds to complete when I stop holding it down.
I don't have an idea how to deal with performance issue. Anyway we need to read all files size in a "show file size" mode. It can be done on read_dir function only once per directory but we may get a huge delay when reading big directories.
OTOH just toggle it with "z" key and you get the original performance
The another idea may be try to read the whole directory with "ls -l" command output parsing instead of internal globbing (like in "for item in "$PWD"/*; do" line in read_dir function. Will think about that, that requires read_dir rewriting
The problem with that approach is that the output of ls
shouldn't be used in scripts (when related to using the file name portion.). ls
prints the list items in a way where it can't be guaranteed that it matches the actual file name.