-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
alias
broken on paths with spaces
#4741
Comments
Unfortunately, this is working as expected. Alias exists for compatibility with bash, and that's what bash does here. This is so things like We could obviously change it, but
I'd assume you are hit more with this because you're on WSL. On unix, spaces in command paths are even rarer than vowels (they've even cut the trailing e in "create"). This is one more reason why I'm constantly telling people to just define the function instead. |
The workaround is to double-escape spaces. I.e. alias test "test\ dir/test" |
I presumed the workaround would work (without trying it though, tbh), but was wondering just what the actual semantics here are. Fish already hard breaks away from posix/bash compatibility when it comes to spaces and escaping everywhere else; I'm not sure preserving the compatibility with bash is the right thing to do here, IMHO. There's an out, though. The official fish syntax is i.e.
(and, yes, WSL is to blame here) |
I should point out that my concern here isn't getting |
For a couple of functions, compatibility is explicitly the reason why they exist. This applies not just to I think you might have noticed that I'm not a massive fan of
Anyway, we have it, and removing it is probably unreasonable.
Note that that currently does not work, probably because of f156bea. However, the syntax is stated in the documentation, so it should work, and since we haven't had any complaints about it not working, that probably means that nobody is using it. Which means we're probably not going to inconvenience anyone by changing it, but on the other hand, nobody'll use the improved version. If you want to add it, feel free to do so. |
Ah, I wouldn't have run into that issue. I normally use functions but will use aliases to literally provide an alias for a command, e.g. on Linux |
This is probably not happening. I recommend using functions instead of alias. |
|
Okay, no, closing this again. I don't think we want to break alias compatibility here, and the current semantics are arguably correct - you need to distinguish calling the |
Looking at the output of
type test2
reveals the problem:The text was updated successfully, but these errors were encountered: