Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow walking multiple root directories #4109

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

msabathier
Copy link

Hi,
I have been trying to search a file or directory with fzf on Windows on multiple drives.
I managed to do it by piping the output of Get-ChildItem cmdlet (slow) and then the output of fd (faster but not ideal).
It was not a satisfying solution to me so i started to look at the code of fzf and found a solution to this problem by using a comma separated list in the --walker-root argument.
I am not proficient in go so the implementation might not be what you are looking for, don't hesitate to guide me towards a solution that suits you.
Best regards,
Martin

@junegunn
Copy link
Owner

then the output of fd (faster but not ideal)

Can you explain why it felt not ideal? fd is a dedicated directory traversal program with much more versatility (notably .gitignore support). The built-in walker of fzf can be a good default for many users, but it isn't supposed to be, or tries to be, as good as dedicated external programs.

@msabathier
Copy link
Author

msabathier commented Nov 23, 2024

That was also my initial thought, but after a bit of testing, I found that the built-in walker was actually quite faster than fd, at least on Windows (maybe the piping is introducing some overhead ?).

Also when using fd, the pipe crashes if I select a result before fd has finished executing. This can probably be fixed but it led me to test other solutions first, one of which was this PR that I found was faster and more practical than using fd.

@junegunn
Copy link
Owner

/cc @charlievieth FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants