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

Rye+Fish: Add Shims to Path #432

Closed
hhstore opened this issue Aug 30, 2023 · 3 comments
Closed

Rye+Fish: Add Shims to Path #432

hhstore opened this issue Aug 30, 2023 · 3 comments

Comments

@hhstore
Copy link

hhstore commented Aug 30, 2023

Add Fish Env:

  • https://rye-up.com/guide/installation/
  • The rye documentation does not provide environment variable settings for fish shell, I read the env file, supplementing the following available setting methods.
  • If you are using fish, you can set the environment variables as follows.
  • Alternatively, it can be updated to rye's documentation.

fix for fish shell:

  • add to ~/.config/fish/conf.d/env.fish:
# python + rye: $HOME/.rye/shims
set -gx PATH "$PATH:$HOME/.rye/shims"
@mitsuhiko
Copy link
Collaborator

Do you know if there is a way for fish to source posix shell files? (eg .rye/env)

@hhstore
Copy link
Author

hhstore commented Aug 31, 2023

  • @mitsuhiko I looked it up and fish shouldn't support source posix shell files by default, but found a plugin foreign-env. Using this plugin, it can be solved.
  • In addition, I found that rustup encountered the same problem, and the solution given by the community was the same as my first approach. There is reason to believe that the community did not find a better way.

another solution:

omf install foreign-env
  • edit ~/.config/fish/config.fish
# fenv + rye: source "$HOME/.rye/env"
if status --is-interactive
  fenv source "$HOME/.rye/env"
end
# rye end
  • I've tested it and it works fine.

reference:

@mitsuhiko
Copy link
Collaborator

mitsuhiko commented Aug 31, 2023

Sounds like the best thing would be to add this to the docs:

set -Ua fish_user_paths $HOME/.rye/shims

Maybe print that out as an alternative if fish is detected in the installer.

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

No branches or pull requests

2 participants