-
Notifications
You must be signed in to change notification settings - Fork 830
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
Make ASDF_FORCE_PREPEND
consistently default to "yes" on all platforms
#1579
Comments
cc @hyperupcall |
It seems we have different expectations on what is reasonable behavior. All other supported shells do not automatically prepend, so this is in line with other shells. But, changing it back would mean inconsistency with other shells, but consistency across platforms. I view my changes more intuitive because you'll generally get the same behavior on the same machine. And the exception, macOS, exists due to inherent problems of macOS (namely, the broken Unless there is something specific that breaks (like #1550), then I'm inclined to leave things how they currently are. Our behavior is currently aligned with all popular tools like other version managers that modify the |
I've taken a look at what other version managers did (or didn't) do about this:
Once I personally haven't used any version managers that went with a platform-specific workaround for |
@gabrielsoldani Thank you for your comment and detailed links. I may have looked at reference code too quickly and it seems that automatically prepending is the more common route, so I was mistaken. But to fix this, I would like things to remain consistent across all shells - so all shells automatically prepend instead of just Bash/Zsh/dash. Not all of the code exists for that so it's not as simple as defaulting |
So this was the commit that changed things. My intentions are to fix this. |
@hyperupcall No problem! :) Thanks for re-evaluating this decision. I haven't used the non-Unix shells yet, but I'll gladly take a look and contribute this change, if you prefer. It might be a good first contribution and a chance to try these shells out. |
I think @gabrielsoldani makes some very good points about this. While I don't feel to strongly one way or the other, I think I'm more in favor of prepending by default.
Is this true with |
Is your feature request related to a problem? Please describe
Before 0.12.0, sourcing
asdf.sh
on Zsh and Bash always prepended the asdf entries to thePATH
. It also looked to see if the entries were already present, and if so, removed them (this isn't strictly necessary since duplicatePATH
entries are fine, but it's nice).On 0.12.0, the behavior changed with the addition of the
ASDF_FORCE_PREPEND
setting (#1560). The idea is that by setting it to "no", sourcingasdf.sh
will only prepend asdf'sPATH
entries if they aren't already present in thePATH
."no" was chosen as the default, but this broke the behavior on macOS (#1550), where
path_helper
reorders the inheritedPATH
. So "yes" was chosen as the default for macOS.In my understanding, this setting was included in order to let users have more fine-grained control over their
PATH
and to align Zsh/Bash/POSIX shell behavior with other shells supported by asdf.This meant that 0.12.0 introduced a breaking change, but only to non-macOS users.
Describe the proposed solution
I propose that the default value of
ASDF_FORCE_PREPEND
should be "yes" on all platforms.PATH
by virtue of choosing when to sourceasdf.sh
in their shell profile.asdf.sh
withASDF_FORCE_PREPEND=no
if they want more fine-grained control.asdf.sh
on a POSIX shell does the same thing to theirPATH
across all POSIX-compatible systems.asdf.sh
interactively consistently restores asdf'sPATH
precedence. This is probably what the user expects, and when it doesn't work, they don't need to search the documentation to find theASDF_FORCE_PREPEND
variable and realize they need to runASDF_FORCE_PREPENT=yes . $HOME/.asdf/asdf.sh
instead, but only if they're not on macOS.I'd be happy to contribute the changes to the code and the documentation.
The text was updated successfully, but these errors were encountered: