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
Add an option to select instantly when the search only finds one answer #2494
Comments
Looks like the documentation has room for improvement. Let me explain.
If you're looking for a terminal version of dmenu, you might want to take a look at https://github.com/p-gen/smenu. It may be a better choice than fzf for simple menus. |
I know you've thought this through carefully, but would like to share a different perspective (and hopefully convince you to at least reconsider):
If you've read this far, thank you for your time! :) |
If anyone is interested in this functionality, I'm using the following as a workaround (in bash):
|
man fzf
)Info
Problem / Steps to reproduce
Hello, I wanted to ask if it were possible to add an option to enable the following behavior: when typing in the query field, if fzf encounters only one result (the filter returns only one entry), it gets selected immediately, and fzf exits, without needing the user to hit 'enter' to validate the selection. Dmenu for example has that option, in the shape of a patch, called 'instant' https://tools.suckless.org/dmenu/patches/instant/
To be clear this is different from the behavior of --select1, which solely checks if the input is comprised of a single entry/item. Here, even if the input were to be many items, when the user searches through those items, if the search results become depleted to the point when there is only one result left, that result would be immediately accepted and fzf would quit.
Originally when reading the man page, I actually thought that --select1 did what I am proposing it. I was overjoyed till I tested it and it ended up not working at all like I expected. On that front I feel like perhaps the man page should be reworded: "Automatically select the only match" to me sounds closer to the behavior I'm talking about here, though it depends on what the definition of 'match' is. Perhaps "Automatically select the only input item" might be more explicit, or something similar?
In some sense this option I'm proposing kind of subsumes --select1, I think, but also allows the behavior of 'automated acceptance' to be triggered during a search/filtering made by the user, and not just at the launch of the program.
I might consider trying to code that behavior myself and then ask for a pull, if you are not against the feature as an idea/concept but you would deem it low priority on the realization level.
The text was updated successfully, but these errors were encountered: