Skip to content
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

Hide search interface in --phony mode #2890

Closed
4 of 10 tasks
Friptick opened this issue Jul 23, 2022 · 8 comments · Fixed by #4210
Closed
4 of 10 tasks

Hide search interface in --phony mode #2890

Friptick opened this issue Jul 23, 2022 · 8 comments · Fixed by #4210

Comments

@Friptick
Copy link

Friptick commented Jul 23, 2022

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • 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

@junegunn
Copy link
Owner

junegunn commented Aug 3, 2022

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.

@Friptick
Copy link
Author

Friptick commented Aug 3, 2022

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.

@junegunn
Copy link
Owner

junegunn commented Aug 4, 2022

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.

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.

@Friptick
Copy link
Author

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.

@Daghall
Copy link

Daghall commented Feb 27, 2023

@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. 😉

@Friptick
Copy link
Author

Ugh, all so hacky! 😆 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 🤣

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.

@Daghall
Copy link

Daghall commented Feb 28, 2023

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! 👍

junegunn added a commit that referenced this issue Jan 29, 2025
Close #2890

I can't think of many use cases. Maybe for really simple menus?

You can' type in queries in this mode, and the only way to trigger an
fzf search is to use `search(...)` action.
@junegunn
Copy link
Owner

junegunn commented Jan 29, 2025

See #4210. Thoughts? I'm not quite convinced if we should really have it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants