Skip to content

tilde characters in scripted tab completions are escaped (sometimes) #4570

@msteed

Description

@msteed
msteed@bones:~> fish --version
fish, version 2.7.0
msteed@bones:~> echo $version
2.7.0
msteed@bones:~> uname -a
Linux bones 4.13.12-1-ARCH #1 SMP PREEMPT Wed Nov 8 11:54:06 CET 2017 x86_64 GNU/Linux
msteed@bones:~> echo $TERM
tmux-256color
msteed@bones:~>

The problem:

msteed@bones:~> sh -c 'env HOME=$(mktemp -d) fish'
Welcome to fish, the friendly interactive shell
msteed@bones /h/msteed> cd
msteed@bones ~> mkdir -p a/b
msteed@bones ~> cd a/b
msteed@bones ~/a/b> cd
msteed@bones ~> cdh a<TAB>

When I hit Tab, fish supplies this completion:

msteed@bones ~> cdh \~/a/b

If I accept that, fish (correctly) complains:

cd: The directory “~/a/b” does not exist

If I hit Tab with an empty directory name, i.e., cdh <TAB>, fish lists the completions with the ~ characters escaped, but selecting a completion un-escapes the string so the command line is formatted correctly.

Edit: this may be the problem reported in #4566

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intendedcompletions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions