Skip to content

Unfriendly user experience when auto suggestions are provided but completions are blocked #5237

Open

Description

@mqudsi

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 -c cat -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.

Activity

  1. faho commented on Oct 8, 2018

    @faho
    Member

    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").

  2. mqudsi commented on Oct 13, 2018

    @mqudsi
    ContributorAuthor

    If #5238 is rejected then IMHO the only sane option is to block file-based ghosted autocompletions from showing when -f/-x are in effect.

  3. faho commented on Oct 15, 2018

    @faho
    Member

    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.

  4. mqudsi commented on Oct 17, 2018

    @mqudsi
    ContributorAuthor

    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.

  5. mqudsi commented on Oct 23, 2018

    @mqudsi
    ContributorAuthor

    An example that works under master: git show HEAD: will autocomplete a path from the local folder, but tab is unavailable.

  6. faho commented on Oct 24, 2018

    @faho
    Member

    git show HEAD: will autocomplete a path from the local folder, but tab is unavailable

    ":", "=" 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.

  7. mqudsi commented on Oct 24, 2018

    @mqudsi
    ContributorAuthor

    So it seems that we're not suppressing files here correctly, yes.

    I don't know if you meant in the git completions or in the autosuggestions. If the latter, we're on the same page.

  8. faho commented on Oct 24, 2018

    @faho
    Member

    In the suggestions, yes.

    I've not been able to reproduce it without the ":" part, though!

  9. mqudsi commented on Oct 27, 2018

    @mqudsi
    ContributorAuthor

    git checkout -- exhibits the same.

  10. bennofs commented on Mar 2, 2019

    @bennofs

    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)

  11. JulienPalard commented on Oct 9, 2026

    @JulienPalard

    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 ☹

  12. krobelus commented on Oct 16, 2026

    @krobelus
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions