Skip to content

Incorrect tab completion #1127

Closed
Closed

Description

@tclementdev

Enter the following:

sudo ls /Applications/Photo\<space here>

Then hit tab. I'm getting:

sudo ls /Applications/Photo\\\ Booth.app/

instead of:

sudo ls /Applications/Photo\ Booth.app/

Activity

  1. ridiculousfish commented on Nov 17, 2013

    @ridiculousfish
    Member

    Reproduces for me. Good find.

  2. ridiculousfish commented on Feb 4, 2014

    @ridiculousfish
    Member

    The problem here is that in __fish_complete_subcommand, we get the raw commandline contents via set -l cmd (commandline -cop) (commandline -ct) and then hand that off to complete -C. The raw commandline contents includes a backslash, so complete -C sees a backslash.

    I'm still not sure why complete -C produces output though.

  3. ridiculousfish commented on Feb 4, 2014

    @ridiculousfish
    Member

    This is tricky - we have to rationalize whether the input to complete is escaped or unescaped, and whether its output is escaped. I would guess that the most common input to complete comes from commandline, where the user provides escaped data (e.g. includes backslashes). The output needs to be raw, i.e. no backslashes. So I think that builtin_complete needs to have a call to unescape().

    There's potentially other functions (most likely fish functions) that work around this bug by attempting to unescape; we may now be unescaping twice. I guess we have to try it and find out.

  4. ridiculousfish commented on Feb 4, 2014

    @ridiculousfish
    Member

    Thanks for reporting this!

  5. tclementdev commented on Feb 5, 2014

    @tclementdev
    Author

    Thanks for fixing it :)

  6. modified the milestones: , next-major on Sep 27, 2014
  7. locked as resolved and limited conversation to collaborators on Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions