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

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

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

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

Profpatsch opened this issue Aug 5, 2015 · 10 comments
Labels
Milestone

Comments

@Profpatsch
Copy link

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

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

@Profpatsch Profpatsch commented Aug 5, 2015

@faho Then that was that.

@Profpatsch
Copy link
Author

@Profpatsch 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
Copy link
Contributor

@adriaanzon 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
Copy link

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

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

@ridiculousfish ridiculousfish commented Feb 17, 2018

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

@XenGi
Copy link

@XenGi XenGi commented Jun 25, 2018

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

@faho
Copy link
Member

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

@XenGi XenGi commented Jun 25, 2018

ah. didn't see that. thx!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants