-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Option -print-query does not print query string on Abort! #2075
Comments
I see your point but I'd rather not change the current behavior because doing so will break backward compatibility. You can use fzf --print-query --bind esc:print-query+abort |
Thanks... that worked perfectly. Though I left out the --print-query and just used the bind for the specific situation. I am using it in a bash completion selection. This should be in the manual :-) But then I suppose a lot of things should. |
Actually it would be a nice addition for the ls ** completion! That is ** gets replaced by the current query string (if not empty) is the user aborts. |
I just learned about this. Where can I find more info on commands like this? thanks! |
I'm trying to apply this fix to a zsh history search. However, it's using a config like this and I don't know how to apply this fix here:
|
man fzf
)Info
Problem / Steps to reproduce
The
-print-query
generally output two lines, the final query string the user had typed (or updated), and the selection made.However if the user decides none of the selections match by pressing ESC, then nothing is printed! In that case the current state of the query string (which the user had input) is lost!
In summery, either...
1/ If
-print-query
is given, always print the query, even on abort!2/ OR a new option to only output the query string on ESC (abort)
I would still like to see the final query string printed in that case 'ESC' or (abort) action, so what the user has already typed can be used for further refinement, or as a 'user supplied result'. Right now that information is just lost (which can very VERY annoying).
As long as you can still get the final query string, you can use the exit status of fzf to decide how the output (selection or query string) is handled.
If
-print-query
always prints the query string, I could simply tail for the last line, which would be the the users selection, or the query string on ESC-abort. Though a different method may be needed for--multi
Example use... The user is selecting from a very long list of possibilities, but that list may not be complete, or contain what the user actually wants, (a list of known hosts for example). The query string by this time would have likely expanded to what the user actually wants, and did not find.
By returning the query string on an ESC (abort / Interupt selection) that string can be used continue to use the input they have already typed, without losing it.
The text was updated successfully, but these errors were encountered: