Skip to content

How to run fzf first, before the list of input has completed #3508

Closed Answered by junegunn
Jiehong asked this question in Q&A
Discussion options

You must be logged in to vote

Remove --select-1 and fzf will start immediately.

The purpose of --select-1 is to exit without rendering the interactive finder if there's only one match. To determine this, fzf needs some items and until it does, fzf blocks. This is the opposite of what you're trying to achieve.

# Doesn't block
(sleep 2; seq 100) | fzf -q 55

# fzf automatically selects 55 and exits
(sleep 2; seq 100) | fzf -q 55 --select-1

# Because there are more then one matches, fzf starts after 2 seconds
(sleep 2; seq 100) | fzf -q 5 --select-1

# Simliar to --select-1, but it starts the finder immediately
(sleep 2; seq 100) | fzf -q 55 --bind one:accept

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@LangLangBart
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Jiehong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants