-
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
Rename $_ #813
Comments
Indeed. If anything deserves Also, considering other shells actually use |
Ah, I thought it was also like bash's |
There doesn't actually seem to be an equivalent of |
It is unfortunate this var was named It might be useful to introduce an alias. Which would allow us in the future, when we create the fish 3.0 release, to remove |
I've committed this in d367d57 with If there are any objections to the name or better suggestions, please chime in! |
I don't think removing it right now is worth it. I'd rather have both names for a while, and deprecate the old one. Also, I don't really like how many variables with generic names we're now using - |
Please back this out. I agree with @faho entirely. |
Sure thing. If you'll read my commit logs, you'll see similar remarks to your own reservations. I feel |
Yes, there was. The main problem I could see is that $version is something you use to check which version of fish you are dealing with, so it's important that it stays consistent. And unfortunately it was named "$version" from the beginning. We have a few more variables with generic names - $status, $argv - but those are front and center, something you use constantly. Others, like $PATH or $LANG, are standardized across shells. So there's a reasonable expectation you might know them. This stuff - $pid, $current_command, $hostname - has names that might already be in use in user's scripts, or that users might want to use. And they're used much less often, so users might not know or might have forgotten about them. So, what would I use? For $pid, I'd use For $last_pid, I'd tell people to use For For But the important thing is that we keep the old versions for a while (as in the next 2-5 years). There really is no reason to rush these cosmetics. (I feel less strongly about keeping "%" expansion, though, because it's barely used and sucks. If we kept "%self" as a special case that would solve 99% of uses) |
I am all for Now that I think about it, there's no need for I'm open to one other suggestion here: we can call it |
Oh, and with regards to I mentioned elsewhere my original idea of taking advantage of the fact that |
Can we keep |
They reserve the |
FWIW, You need to revert commit d367d57 ASAP. See the discussion in Gitter started by @nafg. That commit breaks updating the terminal title since, among other uses, the default title function uses the old var:
You cannot blindly replace a public var in this fashion without a lengthy transition period. |
My previous comment also applies to several other recent var renames of this sort. Just because those renames are happening in a major release does not mean you can unilaterally invalidate the old var name. |
One way of looking at it is that you're essentially exposing a programming
API, so having a deprecation cycle is not much different than in any code
library or framework.
That said, if fish_title had been updated too, I would never have noticed
anything wrong.
…On Fri, Mar 23, 2018 at 1:44 AM Kurtis Rader ***@***.***> wrote:
My previous comment also applies to several other recent var renames of
this sort. Just because those renames are happening in a major release does
not mean you can unilaterally invalidate the old var name.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#813 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGAUNOWkBMcucaXRA3VTmIOmEbdz6x6ks5thIuvgaJpZM4ArTwG>
.
|
Mea culpa. I searched Again, though, the intention was always to provide a shim for compatibility before 3.0, but was soliciting feedback on the best approach (ref commit msgs). It would have been better to open a PR instead of commit directly in that case, so I take full responsibility. |
I suppose I also agree with @krader1961 in that it is too late to change this as doing so breaks backward compatibility for virtually no benefit. I know |
@jorgebucaran: Yes, it's still there. |
@faho Good to know. Thanks! 🎉 |
The name is inconsistent with the rest of fish and as far as I know not even consistent with other shells. Not even that consistent with Perl's topic variable!
The text was updated successfully, but these errors were encountered: