-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Use powershell for default command on Windows #960
Comments
Unfortunately PowerShell is really slow. I love PowerShell, but dir is way faster, and that's what I use for my PowerShell wrapper module: https://github.com/kelleyma49/PSFzf/blob/master/PSFzf.psm1#L346. Another option is to create and compile a small app written in C# or C++ that can do the directory listings. |
It's speed vs accuracy. a) Get 10000+ results but require non-trivial search syntax to reduce to 10%. Hope that the path is short enough to see the file in the rightmost side of the cmd.exe terminal.
The updated powershell command achieves this with similar output to the My everyday experience with fzf is run |
powershell has a pipeline issue where the equivalent of |
Related: junegunn#960 (relative filepaths)
Related: junegunn#960 (relative filepaths)
Running fzf consecutively with powershell as default command slows down low-spec machines even if fzf exits. Same applies to the Windows port of find, ack, and ag. The issue remains that the directories and hidden files appear in the default command. |
dir /s/b
does not filter hidden directories/files and its results cannot be piped to anotherdir
command.I can't get
dir /b/a:-d-h | dir /s/b
to work in cmd.exe to filter hidden directories before recursing on subfolders.Powershell does not have these issues because of object piping and output customization.
The following command works in cmd.exe and runs powershell on default settings to recursively get all non-hidden files. This takes up more time but removes files in hidden directories such as
.git
. Additional parameters are added to the powershell.exe to reduce the startup time.powershell.exe -NoLogo -NoProfile -Noninteractive -Command "Get-ChildItem -File -Recurse | ForEach-Object {echo $_.FullName}"
Edit:
Get-ChildItem
supports-Name
for relative path so object piping is not required.powershell.exe -NoLogo -NoProfile -Noninteractive -Command "Get-ChildItem -File -Recurse -Name"
The text was updated successfully, but these errors were encountered: