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

Completing a folder misses an escape on the first char #2274

Closed
Profpatsch opened this Issue Aug 5, 2015 · 10 comments

Comments

Projects
None yet
6 participants
@Profpatsch
Copy link

Profpatsch commented Aug 5, 2015

When completing a folder and selecting an entry from the list, if that entry starts with a character that should be escaped, it isn’t.

Example:

~/Downloads/[TAB TAB TAB
select entry [foobar] my file

Completion: ~/Downloads/[foobar\]\ my\ file

Note the missing \ before the first [.

@faho

This comment has been minimized.

Copy link
Member

faho commented Aug 5, 2015

I can't reproduce with that specific case:

$ touch ~/Downloads/"[foobar] my file"
$ rm ~/Downloads/ # and tab-select the right file
$ rm ~/Downloads/\[foobar\]\ my\ file

I can however get this if I enter a literal "[" and then complete. Fish will complete the file, but won't escape the "[" (and then highlight it as invalid).

@Profpatsch

This comment has been minimized.

Copy link

Profpatsch commented Aug 5, 2015

@faho Then that was that.

@Profpatsch

This comment has been minimized.

Copy link

Profpatsch commented Aug 6, 2015

Oh, and aditionally: When starting the completion item with \ it doesn’t find anything. So there is no way to complete in a working way.

@adriaanzon

This comment has been minimized.

Copy link
Contributor

adriaanzon commented Jan 30, 2017

I noticed today when yarn created a directory named ~, the completion doesn't escape the tilde character.

So imagine you're typing rm -rf <TAB><TAB>, it will produce rm -rf ~/ which is not quite what you had in mind.

@bmwalters

This comment has been minimized.

Copy link

bmwalters commented Feb 4, 2018

I ran into this issue today (Fish 2.7.1), and was ready to file a new issue report when I found this one. Here's an asciicast:

asciicast

This can cause a surprising behavior when interacting with a file named ~<your username> and selecting it using tab completion. Since the ~ is not escaped, the resulting command will reference ~<your username> which Fish helpfully expands to your home directory.

Notice that the tilde is actually escaped in the list of completion suggestions before selecting one, oddly enough.

@Profpatsch

This comment has been minimized.

Copy link

Profpatsch commented Feb 5, 2018

the resulting command will reference ~ which Fish helpfully expands to your home directory.

Hooooo, boy. That’s bad.

@ridiculousfish ridiculousfish modified the milestones: fish-future, fish-3.0 Feb 17, 2018

@ridiculousfish

This comment has been minimized.

Copy link
Member

ridiculousfish commented Feb 17, 2018

This should be fixed in 01d8745. Thanks for filing!

@XenGi

This comment has been minimized.

Copy link

XenGi commented Jun 25, 2018

Which fish release will include that fix? Is there a schedule for 2.7.2?

@faho

This comment has been minimized.

Copy link
Member

faho commented Jun 25, 2018

Which fish release will include that fix?

@XenGi: Like the milestone says, 3.0. Which is the next release and expected in the near future.

Is there a schedule for 2.7.2?

No. We don't have the man power to maintain multiple release branches.

@XenGi

This comment has been minimized.

Copy link

XenGi commented Jun 25, 2018

ah. didn't see that. thx!

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