Skip to content

What is the best way for an external application to extend fish PATH? #3170

Closed
@gnzlbg

Description

@gnzlbg

There is this issue in rusup (the rust toolchain installer) about supporting the fish shell:

rust-lang/rustup#478 (comment)

After installation it says:

Rust is installed now. Great!

To get started you need Cargo's bin directory in your PATH environment variable.
Next time you log in this will be done automatically.

After installation it updates the PATH variable in .profile but fish doesn't read it (so the next time an user using fish shell logs in cargo, rust package manager, won't be in the user's PATH). Since fish is a very popular shell it would be nice if rustup could support it nicely.

What would be the right way for this kind of tool to:

  • detect whether the user is running fish shell?
  • update their path automatically (if possible)?
  • detect whether the user overrides the path in its config file e.g. set -x PATH ... (without appending $PATH to it)? (in that case the user would need to update it manually)
  • suggest how to manually update fish shell's PATH in a user config file (e.g. go to ~/.config/fish/config.fish and add set PATH ~/.cargo/bin $PATH).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions