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

Cannot quit fzf early with --exit-0 or --select-1 #1686

Closed
4 of 15 tasks
lincheney opened this issue Sep 11, 2019 · 1 comment
Closed
4 of 15 tasks

Cannot quit fzf early with --exit-0 or --select-1 #1686

lincheney opened this issue Sep 11, 2019 · 1 comment
Labels

Comments

@lincheney
Copy link
Contributor

lincheney commented Sep 11, 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

Running the following (in bash or zsh) and pressing escape or enter immediately causes fzf to quit with the appropriate exit code.

fzf < <(sleep 10; echo 123; sleep 10; echo 456)

Running with the --exit-0 or --select-1 flag, however, pressing escape/enter has no effect until the sleep 10 has finished.

fzf --exit-0 < <(sleep 10; echo 123; sleep 10; echo 456) # stall for 10s
fzf --select-1 < <(sleep 10; echo 123; sleep 10; echo 456) # stall for 20s

(Note this is different from (sleep 10; echo 123) | fzf which is the shell stalling, not fzf.)

@junegunn
Copy link
Owner

Well, they are designed to work that way. The purpose of the options is not to start the interactive finder when it's not needed, not to cause unnecessary flickering of the screen while running your script. See #27 and #36 for the background.

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

No branches or pull requests

2 participants