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

How to disable custom (i.e. per-command) autocompletion? #7040

Closed
L-as opened this issue May 26, 2020 · 11 comments
Closed

How to disable custom (i.e. per-command) autocompletion? #7040

L-as opened this issue May 26, 2020 · 11 comments
Labels

Comments

@L-as
Copy link

L-as commented May 26, 2020

A lot of commands have some custom autocompletion (like stack, systemctl, etc.) where they show the possible commands and such, but to be quite honest, it is very common for them to be somewhat broken, and really just in the way of what I'm trying to do.
I can e.g. not unzip a file where the name does not end in .zip, and often, e.g. for systemctl's autocompletion, an error will happen during it!

So I was wondering if there is any simple way to disable custom autocompletion while still keeping the autocompletion for selecting files (which is very useful).

@krobelus
Copy link
Member

There is no way to turn it off for all commands, but for specific commands you can do complete -c unzip -e or create an empty ~/.config/fish/completions/unzip.fish to make it persistent.

I usually insert : (alias for true) at the beginning of the command to get generic file completions, and then delete it before executing. Which is a bit awkward..

We should fix the incomplete completions, though!
Probably the unzip ones should complete any filename.
The systemctl completion error could be #5689 which is fixed in 3.1.0.

@exploide
Copy link
Contributor

I was going to propose the same. If a completion is unhelpful, it should be fixed!

The systemctl error was very annoying but I did not encounter any more error since updating to 3.1.x.

👍 for completing any filename for unzip. There is a ton of file formats actually being just zip files.

@mqudsi
Copy link
Contributor

mqudsi commented May 26, 2020

I've been thinking of an enhancement to fish where a second <TAB> after a first one fails to generate any completions will disable the complete -x behavior and revert to the default to address issues like this without sacrificing the default preference for convention-based filename completion.

@exploide
Copy link
Contributor

How would that go with cycling through completion items by repeatedly pressing <TAB>?

I fear that would be a confusing behaviour. Is it such a common problem? I would still vote for fixing unhelpful completions.

@mqudsi
Copy link
Contributor

mqudsi commented May 27, 2020

No, it would only kick in when there are no completions due to the -x

@faho
Copy link
Member

faho commented May 27, 2020

How is this different from what we used to have (fall back to file completion), other than requiring a second tab press?

Quite often there just are no sensible completions, so adding files is absolutely unhelpful.

@floam
Copy link
Member

floam commented May 27, 2020

That would confuse me on second tab. +1 fix the individual annoying completions.

@floam
Copy link
Member

floam commented May 27, 2020

The zip completions would be better to complete any file name but sort *.zip first.

@faho
Copy link
Member

faho commented May 27, 2020

Nah, we should just stop the suffix filtering in most cases.

It's wrong so often it's not even funny.

faho added a commit that referenced this issue May 27, 2020
It's unhelpful quite often.

See #7040.
@faho faho added the question label May 27, 2020
@floam
Copy link
Member

floam commented May 27, 2020

I think suffix... prioritizing is a better way to go. They at least are more likely to be the desired files.

@faho
Copy link
Member

faho commented May 27, 2020

Anyway, that's a different point.

The question has been answered, the systemctl issue was fixed a while ago, the unzip issue is now fixed (with potential refinement).

I'm closing the issue.

@faho faho closed this as completed May 27, 2020
krobelus added a commit to krobelus/fish-shell that referenced this issue Dec 13, 2020
krobelus added a commit to krobelus/fish-shell that referenced this issue Dec 23, 2020
krobelus added a commit to krobelus/fish-shell that referenced this issue Dec 23, 2020
krobelus added a commit that referenced this issue Dec 23, 2020
krobelus added a commit that referenced this issue Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants