-
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
Cannot set _ alias #8342
Comments
Well, it's actually a builtin. The problem is it is used everywhere and a function overwriting it is pretty problematic. We have a mechanism to reserve some function names. |
It's a builtin since 3.2.0 - #7036. I'd call this an enhancement, if there's anything to do at all - if you override It's the old problem that things have names that mean things. If you call something |
Well, I decided to reserve it. I guess my thinking was that like |
And right call on the enhancement label. Oops. |
That's okay. I guess you could override it to disable translations, but the $LC_MESSAGES is probably the right avenue for that (or rebuild fish and disable gettext). |
Okay cool. Having been AWOL 2020, I actually was caught by surprise (pleasantly) @faho had promoted this to a builtin, but I had long wondered why the heck it wasn't prior. It'd have made sense to reserve it since introducing it, but really before it was a builtin we couldn't even prevent overriding at all. We can only do that now because of that change. I wonder how we'd have approached this issue a few years ago? Perhaps defining any function that exists on-disk, if done "manually" while interactive, ought to give some friendly output indicating an autoloaded function has been successfully overwritten? |
It was part of fish's minimalist bent - we used to have that "Law Of Minimalism" that forbade anything from being a builtin if it could be a command. This even included
Probably not at all - "if it hurts, don't do that". Which I would still find acceptable - you could also override e.g. The reason we made builtin names reserved was, for the most part, because they can't be overridden without breaking functionality - We did it for |
In fish, _ is defined as a function.
So when you set the alias, commands such as "type" don't work properly.
e. g.
Is there a workaround for this?
The text was updated successfully, but these errors were encountered: