Skip to content
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

Check if rtx bin path is already on PATH when calling rtx activate #10

Closed
amoosbr opened this issue Jan 27, 2023 · 2 comments · Fixed by #16
Closed

Check if rtx bin path is already on PATH when calling rtx activate #10

amoosbr opened this issue Jan 27, 2023 · 2 comments · Fixed by #16

Comments

@amoosbr
Copy link
Contributor

amoosbr commented Jan 27, 2023

When eval "$(rtx activate -s zsh)" is run on shell loading, the directory of the rtx binary is added to the front of PATH.
Although the directory is already on the path. Therefore overwriting my custom PATH order.

Fix:

rtx checks, if the bin path is already in PATH and only updates the PATH when needed.

Reproduce:

.zshrc

echo $PATH
eval "$(rtx activate -s zsh)"
echo $PATH

start new terminal shell:

/Users/user/bin:/Users/user/.local/bin:/Users/user/.cargo/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin

# /opt/homebrew/bin: added although already on the PATH, overriding the custom order

/opt/homebrew/bin:/Users/user/bin:/Users/user/.local/bin:/Users/user/.cargo/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
@jdx
Copy link
Owner

jdx commented Jan 27, 2023

shoot, I actually thought of this and checked to make sure it behaved correctly for fish but didn't think about bash/zsh. This should be an easy fix.

@jdx
Copy link
Owner

jdx commented Jan 28, 2023

this fix is out in 1.2

jdx added a commit that referenced this issue Jun 1, 2024
fix: remove remark about Zulu distribution that no longer applies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants