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

child processes are not terminated - output redirection unusable #1702

Open
4 of 16 tasks
mwallner opened this issue Sep 27, 2019 · 1 comment
Open
4 of 16 tasks

child processes are not terminated - output redirection unusable #1702

mwallner opened this issue Sep 27, 2019 · 1 comment

Comments

@mwallner
Copy link

mwallner commented Sep 27, 2019

  • Category
    • fzf binary
    • fzf-tmux script
    • Key bindings
    • Completion
    • Vim
    • Neovim
    • Etc.
  • OS
    • Linux
    • Mac OS X
    • Windows
    • Windows Subsystem for Linux
    • Etc.
  • Shell
    • bash
    • zsh
    • fish
    • powershell / cmd

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

image
(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
1

Screenshot 2: after fzf finished, the child cmd.exe with pid 1180 keeps running,
2

  • 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.

@mwallner 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
@janlazo
Copy link
Contributor

janlazo commented Oct 2, 2019

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

No branches or pull requests

3 participants