-
-
Notifications
You must be signed in to change notification settings - Fork 826
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
[BUG] Full-path search and globbing leads to fd
not exit on pipeline closing
#1479
Comments
Well, the deeper issue is that |
Oh wait, I guess that's on purpose. |
> (fd -gp '**' / | exit)
# exits normally
> (fd -gp '**' / | fzf)
# exits normally
> fd -gp '**' / | fzf
# exits normally
> (fd -gp '/home/me/**' / | exit)
# exits normally
> (fd -gp '/home/me/**' / | fzf)
# blocks
> fd -gp '/home/me/**' / | fzf
# blocks
> (fd -gpHL '/home/me/**' / | exit)
# forks??
> (fd -gpHL '/home/me/**' / | fzf)
# also forks
> fd -gpHL '/home/me/**' / | fzf
# blocks |
Hmm I'm not sure what you mean by "forks". But as far as I can tell the behaviour of all those commands is within the expected range. > (fd -gp '/home/me/**' / | fzf) it's quite possible that See #472 for some related discussion about detecting closed pipes. |
Thank you, I now undestand the problem. I didn't know how terminating the pipe works, my assumption was that a signal is sent when the receiving process exits, not when the sending process tries to write data. By "forks" I mean fd starts to consume a lot of CPU and the process becomes independent of where I launched it from. I can even close the terminal and it's still running, as can be inspected in a process monitor utility. |
Checks
Describe the bug you encountered:
The shortest example I came up with is this:
I noticed it sometimes doesn't seem to happen when a
**
pattern is used, only with single*
or with both*
and**
, but it's hard to establish a clear pattern.Where it matters practically though is when piping into fzf. It will not abort the search even when fzf has exited.
One workaround I found for my use-case specifically is to make fzf invoke fd itself, i.e.
FZF_DEFAULT_COMMAND='fd -gp "*" /' fzf
. Alternatively, something likefd -gp "*" / | { (fzf; exit) }
can also work.Describe what you expected to happen:
fd
should exit the same way it does with regex search.What version of
fd
are you using?9.0.0
Which operating system / distribution are you on?
The text was updated successfully, but these errors were encountered: