You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unfriendly user experience when auto suggestions are provided but completions are blocked #5237
In cases where complete -x blocks non-native completions, the ghosted autosuggestions retrieved from path context (not history) are probably more hurtful than helpful, as they imply that there are options available for completions but pressing tab yields nothing.
e.g.
touch foo foo1 foo2
complete-ccat-ax bar
cat fo
fish will ghost autocomplete foo but the only way to select that is to use accept the commandline suggestion (arrow right). There's no way to access fish's knowledge of foo1 or foo2, and if one is accustomed to accepting such a suggestion with TAB, that will fail.
This just appears like a bug in that completion script to me, that should be fixed by removing that "-x" (and potentially replacing it with just a "-r").
the only sane option is to block file-based ghosted autocompletions from showing when -f/-x are in effect.
Wait... that's already supposed to be happening?
Can you retry your original problem? I've just tried, and after changing -ax to -xa (since the former errors out) with history disabled (set -g fish_history ''), I don't get any suggestion for cat.
You're right, I can't reproduce it with the cat example I provided. I couldn't get it to reproduce and was going to go crazy since I explored it thoroughly when I first experienced it, then I realized you already committed a fix for git rebase --exec (thank you!).
Using the git completions script as of 3b33616, try the following:
mkdir temp
cd temp
git init .
touch bar
git rebase -i master --exec b # but don't press enter here
At this point, bar will be ghost autocompleted at the commandline but bar is not an option shown by the pager upon TAB. In fact, since in this case there are no completions matching b in this git repo, when you hit TAB you get that horrible terminal bell.
I've been extremely frustrated by this (as in, not able to just shrug it off) each time it's happened to me, but it makes sense that it's not a normal case because it doesn't happen to me often at all.
Another example: scp x: shows path-based local autosuggestions which aren't selectable using TAB (and not correct either, since the part after : is a remote path)
Also git push origin foo:, here the autosuggestion differs from the choices available via TAB. (tab completion shows remote branches, suggestion is local file paths)
Unfriendly experience mixing autosuggestions and autocompletions:
$ touch fooa.py
$ python3 foob.py # Fails, foob.py does not exists :)
$ python3 foo
Here the ghost suggestion is b.py to complete for foob.py as previously typed. But a user not having a perfectly clear understanding of autosuggestion vs autocompletion may hit <tab> to accept b.py, but the autocompletion will complete a.py (the only valid completion), very surprising ☹
It seems hard to improve this without breaking expectations in tab-completion.
As a workaround, one can use shift-delete to delete the incorrect command from history.
Of course the issue can also happen for correct commands, but fish's valid path check makes that less likely
Activity
faho commentedon Oct 8, 2018
This just appears like a bug in that completion script to me, that should be fixed by removing that "-x" (and potentially replacing it with just a "-r").
mqudsi commentedon Oct 13, 2018
If #5238 is rejected then IMHO the only sane option is to block file-based ghosted autocompletions from showing when
-f/-xare in effect.faho commentedon Oct 15, 2018
Wait... that's already supposed to be happening?
Can you retry your original problem? I've just tried, and after changing
-axto-xa(since the former errors out) with history disabled (set -g fish_history ''), I don't get any suggestion forcat.mqudsi commentedon Oct 17, 2018
You're right, I can't reproduce it with the
catexample I provided. I couldn't get it to reproduce and was going to go crazy since I explored it thoroughly when I first experienced it, then I realized you already committed a fix forgit rebase --exec(thank you!).Using the git completions script as of 3b33616, try the following:
At this point,
barwill be ghost autocompleted at the commandline butbaris not an option shown by the pager uponTAB. In fact, since in this case there are no completions matchingbin this git repo, when you hitTAByou get that horrible terminal bell.I've been extremely frustrated by this (as in, not able to just shrug it off) each time it's happened to me, but it makes sense that it's not a normal case because it doesn't happen to me often at all.
mqudsi commentedon Oct 23, 2018
An example that works under
master:git show HEAD:will autocomplete a path from the local folder, but tab is unavailable.faho commentedon Oct 24, 2018
":", "=" and "@" are a bit special in
complete. E.g=is used for--opt=val, and "val" needs to be completed separately.So it seems that we're not suppressing files here correctly, yes. That is a very special case though.
mqudsi commentedon Oct 24, 2018
I don't know if you meant in the git completions or in the autosuggestions. If the latter, we're on the same page.
faho commentedon Oct 24, 2018
In the suggestions, yes.
I've not been able to reproduce it without the ":" part, though!
mqudsi commentedon Oct 27, 2018
git checkout --exhibits the same.bennofs commentedon Mar 2, 2019
Another example:
scp x:shows path-based local autosuggestions which aren't selectable using TAB (and not correct either, since the part after:is a remote path)Also
git push origin foo:, here the autosuggestion differs from the choices available via TAB. (tab completion shows remote branches, suggestion is local file paths)JulienPalard commentedon Oct 9, 2026
Unfriendly experience mixing autosuggestions and autocompletions:
$ touch fooa.py $ python3 foob.py # Fails, foob.py does not exists :) $ python3 fooHere the
ghostsuggestion isb.pyto complete forfoob.pyas previously typed. But a user not having a perfectly clear understanding of autosuggestion vs autocompletion may hit<tab>to acceptb.py, but the autocompletion will completea.py(the only valid completion), very surprising ☹krobelus commentedon Oct 16, 2026