fzf
fzf copied to clipboard
Hide search interface in --phony mode
- [x] I have read through the manual page (
man fzf
) - [ ] I have the latest version of fzf
- [x] I have searched through the existing issues
Info
- OS
- [x] Linux
- [ ] Mac OS X
- [ ] Windows
- [ ] Etc.
- Shell
- [x] bash
- [ ] zsh
- [ ] fish
Problem / Steps to reproduce
In --phony
mode, "fzf becomes a simple selector interface" (says manual). The search prompt becomes useless, but it still accepts text. A bit confusing and ugly.
The hack of --bind='change:clear-query'
helps a bit but the surely the best UX is just to disable and hide the whole line when in --phony
mode?
Thanks for considering, and for your work on this amazing tool.
Version 0.20.0 Ubuntu LTS
Related: #2159
So the thing is, I added --phony
(now --disabled
is the official name) to make change:reload
bindings usable. Making fzf a simple, non-searchable menu was not a part of the plan.
- https://github.com/junegunn/fzf/blob/master/ADVANCED.md#using-fzf-as-interative-ripgrep-launcher
Fair enough. And sorry for missing the existing issue. Will try the smenu
you mentioned there, maybe it's a better fit
The problem is that the zombie search box makes the feature feel incomplete. If non-searchability is really out of scope, then maybe it would be more coherent to just revert the whole feature.
Anyway, it's your project. Go ahead and mark this as wontfix
or similar. Thanks.
If non-searchability is really out of scope, then maybe it would be more coherent to just revert the whole feature.
The option has valid use cases as shown above; search functionality is delegated to an external process started by
change:reload
binding.
- See https://github.com/search?q=fzf+disabled+change%3Areload&type=code
And there are creative use cases like this:
printf 'Definition\nSynonym\nAntonym' |
fzf --reverse --disabled --preview 'if [ -n {q} ]; then echo {} of {q}: ...; else echo Type in a word; fi'
makes the feature feel incomplete
True, especially when the user is not aware of such use cases. But we can't just change the way it works now. I'm going to leave this open and see if we can think of a nice idea to improve it.
Got round to trying smenu
. It doesn't offer custom key bindings. :(
Maybe time to rename your project sfzf
- it's too smart! ;)
FYI I'm using it as a very simple CRUD file manager. Having to go thru the Enter key for everything is a deal-breaker.
@Friptick, you could hide it a bit by adding --no-info
and setting the prompt to the empty string --prompt ""
. It will still take up a line, and show the cursor, but it's a bit less conspicuous.
With --reverse
you can use the --prompt "Heading "
as a sort of heading. 🙂
Adding --padding 0,1,1,1
makes it almost invisible. 😉
Ugh, all so hacky! :laughing: Except maybe the second --prompt
idea. That one's my usual approach in this situation - pretend to myself that the ugly side effect is in fact a feature :rofl:
More seriously: nice suggestions, thanks.
In this case BTW I decided in the end to to drop --phony
mode and just use the tool as God (or @junegunn) intended.
Yeah, "creative solutions" is kind of my speciality! 😅
In my specific case --layout reverse-list
works great. It puts the content at the top, but the (empty) prompt and cursor at the bottom. I also incoporated the --bind='change:clear-query'
parameter you mentioned above. So, thanks! 👍