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

Feature: Show list of options without having to double-tab #6924

Closed
thernstig opened this issue Apr 20, 2020 · 8 comments
Closed

Feature: Show list of options without having to double-tab #6924

thernstig opened this issue Apr 20, 2020 · 8 comments

Comments

@thernstig
Copy link
Contributor

thernstig commented Apr 20, 2020

fish 3.1.0
Ubuntu 16.04.6
xterm-256color

Let's say you have three files such as .bashrc, .bash_history and .bash_logout. I believe there is an unnecessary tab that could be removed for autocompletion of these. Here is an example.

  1. vi .b then do a tab, this will show:
  2. vi .bashrc (where bash is highlighted and rc is greyed out)
  3. Tab again and you see .bashrc, .bash_history and .bash_logout below the prompt.

Unless I am missing something, I am thinking that step 3) is unnecessary and that the tab in 1) should directly do both 2) and 3).

@zanchey
Copy link
Member

zanchey commented Apr 21, 2020

I'm going to restate this as "tab completion should always invoke the pager". I thought this had been raised in the past but I can't find it.

My gut feeling is that this would be a controversial change. There are a number of people who dislike the pager (see #2249, though that is more about the search that the pager starts), and a great deal of muscle memory in the existing behaviour.

I wonder if it would be better to make this customisable (eg a binding for complete-with-pager and perhaps complete-unambiguous), though I know we're trying to avoid that.

@krobelus
Copy link
Member

This is an interesting idea, I usually press tab twice in this scenario.

I have implemented this in krobelus@9117c0d, it feels fresh and non-intrusive.
I don't think it's visually distracting - it only changes the behavior when the completion is ambiguous. The user needs to resolve this ambiguity somehow, it doesn't hurt to show the options.

However, I don't know why it has always been like this (also in other shells). Possibly to avoid needlessly cluttering the screen, but luckily fish handles this situation gracefully by only showing four lines when Tab is pressed for the first time.

@thernstig
Copy link
Contributor Author

thernstig commented Apr 21, 2020

You have far more experience with fish and what users feel controversial than I do. But my own gut feeling would be to default to this new behavior.

Reason I am saying so is because I feel that many users that move to fish do it for all the convenience and time-saving features. It makes you feel more productive. So defaulting to this means you would work faster (even how minor it might be). One less tab.

@zanchey
Copy link
Member

zanchey commented Apr 22, 2020

Well, perhaps we can merge it, try it out ourselves, and ask for feedback on the fish-users mailing list?

@krobelus krobelus added this to the fish 3.2.0 milestone Apr 23, 2020
@krobelus krobelus removed the RFC label Apr 23, 2020
@krobelus
Copy link
Member

Well, perhaps we can merge it, try it out ourselves, and ask for feedback on the fish-users mailing list?

Good idea, I just sent out a mail.

Merged, thanks for filing!
I realize I forgot the changelog again, not sure how notable this is.

@zanchey
Copy link
Member

zanchey commented Apr 26, 2020

Definitely notable!

@zanchey
Copy link
Member

zanchey commented Apr 29, 2020

OK, I just tried this and I love it.

@thernstig
Copy link
Contributor Author

Awesome 🥂

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants