joshuto
joshuto copied to clipboard
Program hangs when executing `subdir_fzf` on a large directory
Problem description:
- When executing
subdir_fzf
command in a large directory, e.g.,/
, the view goes to the command line, and it waits for outputs. - Now press
ctrl+c
will exit joshutu, instead of terminatingsubdir_fzf
execution.
Why is this a problem?
- It is not a good practice to do
subdir_fzf
on such a big directory, but sometimes I may accidentally hit the key and executesubdir_fzf
. - When I realize it I want to terminate the execution and return back to joshuto, but now the
ctrl+c
directly terminates joshuto.
Steps to reproduce:
- go to
/
. - execute
subdir_fzf
, and the program hangs. - press
ctrl+c
, and joshutu exits instead of terminatingsubdir_fzf
and returning back to joshutu.
I think the program is waiting for the output of FZF_DEFAULT_COMMAND
here:
https://github.com/kamiyaa/joshuto/blob/95d304fb04a87fbb2534759177f6cd27f5816143/src/commands/subdir_fzf.rs#LL17C1-L28C7
Commenting it and not redirecting stdin of fzf
on line 31 seem to fix the problem.
I think it's fine because fzf
will call FZF_DEFAULT_COMMAD
by itself (I'm not sure).
Closed via https://github.com/kamiyaa/joshuto/pull/309