Closed Susensio closed 1 year ago
The thing is I don't know why it hangs.
Hi Susensio, I wonder if it's possible fish functions don't support streaming in pipelines, so they block until they have received all the data? Anyway, I don't think this isn't a bug with fzf.fish
Hi Patrick, I thought too that something must be wrong with buffering in fish functions.
I know fd is sometimes installed as fdfind, I myself have that issue, thus the alias used. Anyway the hanging is undesirable and unavoidable without command
.
Other problem that I've encountered is that if I alias with arguments fd
to fd --color always
for example, the plugin append twice the same parameter and fd
fails.
I think it would be safer to use command
ed binaries instead of maybe aliases.
What do you think of using fd
or fdfind
? We could check which one is available and use it accordingly.
Let me know what you think and I can submit a PR that handles this edge case.
As stated in https://github.com/fish-shell/fish-shell/issues/1396 it seems that piping from fish function (aliased fd
) to fish function (_fzf_wrapper
) is buffered. That's the problem. I think the easier workaround is to use command
somehow.
Does Search Directory still hang if, instead of creating a wrapper function for fd, you use an alias?
Oh it probably does because fish aliases basically creates a function unlike other shells. Okay yeah, let's add command fd
I'll update the docs to tell people to symlink instead of aliasing. However, I don't want to look for fdfind and use it if it's available because Search Directory is becoming monstrous and I despise maintaining it.
I've submitted a PR #282 that solves the fd
or fdfind
binary problem without aliases. I think it's fairy simple and doesn't add much complexity.
The problem with #280 and symlink that you suggest is that it would be a breaking change and suddenly the extension will stop working for the people that use fish aliases
I have fd aliased to a less pager, like so:
This is causing Directory Search to hang until all results have been found.
280 Fixes than by checking that unwrapped
fd
is called.