-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Rename uppercase shell parameters #4414
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
Comments
This definitely seems like bike shedding and a gratuitous set of changes. I'll also point out that the variables The all uppercase convention typically has two meanings: exported and read-only. It's also just that: a convention and not a hard and fast rule. I think there has been much misguided concern that all uppercase var names aren't always exported. If that was a hard and fast rule we wouldn't need Having said that I don't really care one way or the other. At the end of the day all that really matters is that the public fish vars are clearly documented. Including whether they can be put in the environment to affect a new fish instance and/or it is reasonable to set them as a universal variable. |
If you change it in 2.7.0 you definitely have to support both variants. There have been too many 2.x changes, many of which I regret advocating for, that were not backward compatible. Let's not add another (and only) backward incompatible change to the final 2.x release. |
Also, consider that |
Final comment: It is reasonable to rename P.S., That uvars are machine specific is a whole different discussion. |
I'd like to see all the proposed renames happen. |
I agree with this, let's do it. |
There's also |
I'd also prefer |
I've got to say I'm perplexed by the recently merged commit to change P.S., If you change |
That may be how you use it for your one-offs, but It could just as well be used to implement session-based history like Terminal.app does with bash where you would not export it. I don't see how there's anything about it that explicitly means it should be exported.
Makes sense. |
So that caused me to search for https://www.reddit.com/r/osx/comments/397uep/changes_to_bash_sessions_and_terminal_in_el/ |
I wasn't arguing we should look at Bash for guidance here. |
Order is restored in the universe. Fixes #4414
It's done. I have become light, bird, wind. My leaves sing. The uppercase vars have been renamed. |
I didn't expect the |
Fish always has supported Rather than name it |
As it was, before this commit, if |
I think the variable scoping rules make it a non-issue, it's almost like it's defined only as a fallback. |
Thanks for the explanation. It's unfortunate that |
Can you announce that change in the changelog? I updated to master today and it created some minor issues with a fzf key binding relying on |
Which version is the |
3.0 - the next one.
Currently not. We didn't expect it to be used much in scripts and using We might however rethink a bunch of these renames and keep the old names for a while. |
|
$FISH_VERSION is dropped in 2.7, but every version has $version - fish-shell/fish-shell#4414 - fish-shell/fish-shell@fb8ae04 Comment from @faho in #1316: Unfortunately, $FISH_VERSION was only ever a thing from fish 2.0 to fish 2.7.1. All fish versions from the very beginning though used a variable called simply "$version" to store their version, so that is the one that should be used.
🔥⚠️ Today's fire danger is: HIGH ⚠️ 🔥
This is an issue which has generated high emotion and personal attacks in the past; please conduct debate respectfully and douse all flames with water.
Before releasing 2.7.0, I'd like to consider renaming the
FISH_HISTORY
variable tofish_history
. There is no released version usingFISH_HISTORY
, so I think we can do this safely.I'd also suggest renaming
FISH_READ_BYTE_LIMIT
tofish_read_byte_limit
, either providing both versions in 2.7.0 or renaming it in 3.0.0.The rationale is the convention that lowercase variables are for shell parameters, whereas uppercase variables are for the environment. Consequently, a variable which changes the behaviour of programs other than fish should be uppercase (think
SHELL
,LANG
), whereas variables that change the behaviour of fish only should be lowercase.The difference between these two concepts is well-established in bash and zsh (parameters vs environment), csh and tcsh (variables vs environment variables), but the upper/lowercase differentiation is only explicitly specified in fish's documentation.
The argument has been made that
FISH_READ_BYTE_LIMIT
should remain uppercase, as the intended use case is to set it as an exported variable before launching a new fish instance. I don't support that - it could just as easily be set as a universal variable to affect all instances, and there is some precedent here in thefish_use_fishd
andfish_use_posix_spawn
feature flags (though neither were ever officially documented).The documentation could use some clarification on this point.
I'd like to get 2.7.0 out the door soon, and would appreciate your thoughts.
The text was updated successfully, but these errors were encountered: