Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

tgkokk opened this issue Aug 13, 2015 · 4 comments
Milestone

Comments

@tgkokk
Copy link

@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 cd completion breaks when an apostrophe is used in the path cd completion breaks when an apostrophe is present in the path Aug 13, 2015
@faho
Copy link
Member

@faho 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
Copy link
Author

@tgkokk tgkokk commented Aug 13, 2015

Thanks, works fine with that file.

@jaseg
Copy link

@jaseg 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
Copy link
Member

@faho 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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.