-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Discussion] Restarting source command #974
Comments
@junegunn Have you considered the possibility of binding a timeout after a certain length of time is passed, kind of like how Suppose something like:
With all of that, it would be possible to implement similar behavior to how interactive selectors work, while keeping fzf a simple filter tool. Besides, it could also have other uses, such as allowing scripts with timeout "default" options to be built. Kind of like how multi-boot systems work. A screen that allows the user to interact and choose a option, but it he doesn't do anything, it will just pick the default option (note that, for this to work, the --require-input-before-cursor-hold wouldn't be used). What do you think about that? |
# Reload input list with different sources seq 10 | fzf --bind 'ctrl-a:reload(seq 100),ctrl-b:reload(seq 1000)' # Reload as you type seq 10 | fzf --bind 'change:reload:seq {q}' --phony # Integration with ripgrep RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case " INITIAL_QUERY="" FZF_DEFAULT_COMMAND="$RG_PREFIX '$INITIAL_QUERY'" \ fzf --bind "change:reload:$RG_PREFIX {q} || true" \ --ansi --phony --query "$INITIAL_QUERY" Close #751 Close #965 Close #974 Close #1736 Related #1723
#751 and #965 suggested a new mode of execution where fzf restarts the source command whenever the query string is changed. They specifically wanted this for using fzf with a primary search command such as grep, ag, or rg. Although I can see the appeal, there are obvious impedance mismatches.
And It's not just a simple option but a new, extra mode of execution that is not very "unix-y", and I'm concerned that it will hurt the conceptual simplicity of fzf.
A better idea I believe is to keep fzf simple and implement scripts using the existing options, and I think it's already possible to some level.
--expect
option.--bind change:accept
, and some hacks. Little known and somewhat experimental--no-clear
option can be used to reduce flickering of the screen, but unfortunately it doesn't work nicely with--height
.(code: https://gist.github.com/junegunn/4963bab6ace453f7f529d2d0e01b1d85)
I'd like to focus on non-disruptive, incremental changes we can make to help the development of such scripts. Polishing
--no-clear
comes to my mind first.The text was updated successfully, but these errors were encountered: