You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using fzf on Windows for a while now, but always had trouble when using it with "deeply nested" directory trees.
fzf version
(installed via Chocolatey)
context
I'm using a PowerShell helper cd-fzf which basically calls fzf and tries to do a set-location on the result:
function cd-fzf {
Set-Location (Get-Item $(fzf)).Directory.FullName
}
a simpler example
you should be able to redirect the output of fzf to a variable:
$res = $(fzf)
the problem
the above stated examples work all right, iff the current working directory is not "deep", i.e. the child process that's doing the search in the background is able to finish at some point.
I've noticed, that fzf.exe finishes on press of enter, yet a "leftover" cmd.exe runs as long as it needs to list all files in the current directory.
proof
Screenshot 1: (procexp) fzf during runtime, notice the child cmd.exe with pid 1180
Screenshot 2: after fzf finished, the child cmd.exe with pid 1180 keeps running,
as long as the child process is not being destroyed, the output redirection $somevar = $(fzf) hangs.
suggested fix
actively kill all child processes before exiting fzf.
The text was updated successfully, but these errors were encountered:
mwallner
changed the title
child process cmd.exe is not terminated and renders output redirection unusable
child processes are not terminated - output redirection unusable
Sep 27, 2019
I've been using fzf on Windows for a while now, but always had trouble when using it with "deeply nested" directory trees.
fzf version
(installed via Chocolatey)
context
I'm using a PowerShell helper
cd-fzf
which basically calls fzf and tries to do aset-location
on the result:a simpler example
you should be able to redirect the output of fzf to a variable:
the problem
the above stated examples work all right, iff the current working directory is not "deep", i.e. the child process that's doing the search in the background is able to finish at some point.
I've noticed, that
fzf.exe
finishes on press of enter, yet a "leftover"cmd.exe
runs as long as it needs to list all files in the current directory.proof
Screenshot 1: (procexp) fzf during runtime, notice the child
cmd.exe
with pid 1180Screenshot 2: after fzf finished, the child
cmd.exe
with pid 1180 keeps running,$somevar = $(fzf)
hangs.suggested fix
actively kill all child processes before exiting
fzf
.The text was updated successfully, but these errors were encountered: