cd completion breaks when an apostrophe is present in the path #2299

Closed
tgkokk opened this Issue Aug 13, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@tgkokk

tgkokk commented Aug 13, 2015

$ mkdir -p a\'b/{a,b}
$ cd a\'[TAB] # Error
$ cd a\'b/[TAB] # Error
$ cd a\'b/a[TAB] # Error
$ cd a\'b/a/[TAB] # Error

The error in all cases is:

- (line 1): begin; printf "%s\n" a'*/
 ;end <&3 3<&-
                                 ^
from sourcing file -
    called on line 60 of file /usr/local/share/fish/functions/eval.fish

in function 'eval'
    called on line 45 of file /usr/local/share/fish/functions/__fish_complete_cd.fish

in function '__fish_complete_cd'
    called on standard input

in command substitution
    called on standard input

source: Error while reading file '-'

where a'*/ (the printf argument) changes according to the argument passed to cd.

Other commands (e.g. mkdir) work fine.

@tgkokk tgkokk changed the title from cd completion breaks when an apostrophe is used in the path to cd completion breaks when an apostrophe is present in the path Aug 13, 2015

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Aug 13, 2015

Member

Ah, the joys of using eval.

Can you try #2289? It should be enough to copy share/functions/__fish_complete_cd.fish from that to ~/.config/fish/functions before starting a new fish.

Member

faho commented Aug 13, 2015

Ah, the joys of using eval.

Can you try #2289? It should be enough to copy share/functions/__fish_complete_cd.fish from that to ~/.config/fish/functions before starting a new fish.

@tgkokk

This comment has been minimized.

Show comment
Hide comment
@tgkokk

tgkokk Aug 13, 2015

Thanks, works fine with that file.

tgkokk commented Aug 13, 2015

Thanks, works fine with that file.

@jaseg

This comment has been minimized.

Show comment
Hide comment
@jaseg

jaseg Sep 27, 2015

Same problem also occurs with parentheses in path:

root@newton /tmp# mkdir "foo(bar)"
root@newton /tmp# cd foo\(bar\)/fish: Unknown command 'bar'
- (line 1): bar
            ^
in command substitution
    called on line -1 of file -

from sourcing file -
    called on line 60 of file /usr/share/fish/functions/eval.fish

in function “eval”
    called on line 45 of file /usr/share/fish/functions/__fish_complete_cd.fish

in function “__fish_complete_cd”
    called on standard input

in command substitution
    called on standard input

jaseg commented Sep 27, 2015

Same problem also occurs with parentheses in path:

root@newton /tmp# mkdir "foo(bar)"
root@newton /tmp# cd foo\(bar\)/fish: Unknown command 'bar'
- (line 1): bar
            ^
in command substitution
    called on line -1 of file -

from sourcing file -
    called on line 60 of file /usr/share/fish/functions/eval.fish

in function “eval”
    called on line 45 of file /usr/share/fish/functions/__fish_complete_cd.fish

in function “__fish_complete_cd”
    called on standard input

in command substitution
    called on standard input
@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Sep 27, 2015

Member

@jaseg: Please try #2289.

Member

faho commented Sep 27, 2015

@jaseg: Please try #2289.

@faho faho closed this in 0a99772 Oct 7, 2015

@zanchey zanchey added this to the next-2.x milestone Oct 7, 2015

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