junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
63.4k stars 2.36k forks source link

Multiple pipes broke fzf? #3714

Closed tmpm697 closed 4 months ago

tmpm697 commented 4 months ago

Checklist

Output of fzf --version

0.45.0

OS

Shell

Problem / Steps to reproduce

I have this:

# __fzf_git_commit () {
echo '7e0fb03\n665581a' | fzf --bind=ctrl-u:accept
# <..> -- get $key and $commit here, $commit is commit hash same as one of two above
if [[ "$key" == "ctrl-u" ]]; then
    git show $commit | delta --no-gitconfig | bat --pager "less -R" --file-name "diff commit $commit"
    zle redisplay
    __fzf_git_commit   # --> call this script again, I want to re-list commit hash to select again after `git show above`
# idea is after "git show" I can just select another git commit hash to ctrl-u again.
# }

But I got the issue that I after press ctrl-u, git show show correct contents, then normally I will just press q to exit less to drop to __fzf_git_commit again, but it stuck, I can't exit.

How to exit git show <..> and drop back to `__fzf_git_commit

tmpm697 commented 4 months ago

https://github.com/junegunn/fzf/issues/2579