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

only long options can be selected from completion pager #5634

Closed
floam opened this issue Feb 9, 2019 · 3 comments
Closed

only long options can be selected from completion pager #5634

floam opened this issue Feb 9, 2019 · 3 comments

Comments

@floam
Copy link
Member

floam commented Feb 9, 2019

If a command has a completion that has both a short and long variant with the same description, it's not possible to select an item in the pager and have the short option go onto the command line. The entires are coalesced into the same row on the pager, and the long option is always placed on the command line.

Having stuff like patch --strip 0 --directory src < file.patch in history is annoying. Having commands that are really long makes autosuggestions harder to see in entirety, and when the long format is something the person usually does not use, you will not get history matches against previous times you've typed the command normally using the short options. It's unusual for anyone to actually use the long options for many system utilities, and this is also true for a lot of our builtins, think command -s foo.

If we changed the behavior so that the short option is picked instead out of the two when a pager item with both forms is selected, this would allow the user to pick what they want, because they could still type --<TAB> to get the long one.

I do not think UX is harmed, because the user doesn't benefit from the self-documenting feature of long options here: they already saw the description in the pager, this was selected interactively, they know exactly what the option does.

@floam floam added this to the fish-future milestone Feb 9, 2019
@mqudsi
Copy link
Contributor

mqudsi commented Feb 10, 2019

I actually prefer long options for things I'm not typing non-stop because it's easier to search history and understand what was going on at the time. But I exclusively do so by typing --<TAB>, so I would have no problem with that.

@floam
Copy link
Member Author

floam commented Feb 10, 2019

Yeah, I prefer the long options for many things that aren't used daily, I don't mean to give them the short shrift overall. It's just problematic that one cannot get the completion system to complete short options.

@floam floam changed the title Long options from completions often annoying only long options can be selected from completion pager Feb 10, 2019
@floam floam modified the milestones: fish-future, fish 3.1.0 Mar 16, 2019
@floam
Copy link
Member Author

floam commented Mar 16, 2019

Yeehaw, this is fixed. As a bonus with the short options first, since they're all two characters wide, things line up in columns nicer:

image

I'm also now sorting __ stuff after A-Z stuff in completions, which in e.g. set completions means there's more meaningful stuff at the beginning of the pager, not our __fish junk.

@floam floam closed this as completed in 6e525cc Mar 16, 2019
zanchey added a commit that referenced this issue May 28, 2019
Test changes added for #5634 in 6e525cc.
faho pushed a commit to faho/fish-shell that referenced this issue May 28, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 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

2 participants