-
-
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
Default command outputs relative filepath on Windows (take #2) #1200
Conversation
Requires `/v:on` shell command flag
Thanks, so I guess this doesn't have the performance issue you mentioned in #971?
Just checking if I understood you correctly, you mean |
Yes, because this version of for loop doesn't rely on another command to generate the list of filepaths. Performance difference is negligible.
|
Is poll issue on Windows (golang/go#22024) related to this? |
golang/dep#862 may help. I considered taskkill but I need the pid and I don't know what fzf should do if that gets stuck. |
Have to wait on upstream golang/go#17608. Until it's resolved, Windows users must rely on cmd.exe builtins to avoid orphan processes. |
@junegunn I'd like to test my changes but I have difficulty compiling my local changes. Can you create an alpha version for me? |
Hey @janlazo, I built and uploaded two alpha binaries for Windows with your patch. Find 0.17.4-alpha in https://github.com/junegunn/fzf-bin/releases/tag/alpha |
It works. I don't need sift and rg anymore for relative paths. |
Great. Does it still work with those external tools? Do you think it's safe to merge this? Thanks. |
Ah, I forgot to handle the root directory (ie.
External tools should work as before but |
Reference: |
@junegunn I can test it again if you want but it's good to go. |
Thanks, I replaced the alpha binaries on the page with the updated code ( |
It broke on |
Works on `C:\Program Files (x86)` See end of output of `cmd.exe /?` for the special characters.
0b7720e
to
93527ea
Compare
Now that it's double-quoted, filepaths with It can break for vim undofiles ( I'll add a new entry to restore the old behavior after this is merged. @junegunn If you don't mind, can you compile me another alpha version? |
New binaries are up. |
It worked. I think it's safe to merge now, at least for other users to try out. |
Works for me too, thanks! |
@kelleyma49 Can you test the new default command on Windows? |
I use ConEmu + powershell as well but I haven't encountered that issue. The new default commands relies on Does it happen in cmd.exe (launched directly) or powershell.exe (with |
https://www.ghacks.net/2017/05/16/can-i-delete-getcurrent-sysreset-windows-ws-and-hyper-v-tmp/ |
Good catch. I learn something new about Windows every day! I tested your changes against fzf version 0.17.3. I ran both versions of fzf in my 0.17.3 completes the directory listing in an average of 5 seconds; the version on head completes with an average of 19 seconds. I see similar the similar 4x slowdown in other directories. Is anyone else seeing this slowdown? |
@kelleyma49 Can you benchmark both commands without fzf and warm/cold caches? I used Measure-Command on both commands and ran them on Note that |
@janlazo - I did some more testing by building a version with your change and another version with the previous change. You are correct: I don't see a measurable difference in speed between the two versions. I still see a slow down between the 0.17.3 distributed binary and the exes I build from source. Must be something in my configuration... |
Retry #971 but don't use
dir
. Instead, usefor /r
. It outputs the same files asdir /a:-d/s/b
.Problem is ending the for loop when fzf exits. I don't know what's causing cmd.exe to not terminate.
I added
v:on
flag for now so fzf doesn't run a subshell.