-
Notifications
You must be signed in to change notification settings - Fork 894
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
PATH support doesn't work for fish shell #478
Comments
Many linuxes should be covered by putting the environment to both For OS X it seems like you’d want to also inform launchd about the updated path with Either way this goes, fixing #473 is another thing that would fix a lot of the problem here, since both |
FWIW OCaml's opam has a similar problem and handles it just by having a version of the add-stuff-to-PATH hook for each shell. There's also the "eval (opam config env)" idiom which sets the appropriate environment variables to point to wherever opam thinks they need to point to, including PATH. So a solution like that might work well. |
rustup create |
this still doesn't work. |
I think you can just drop the |
I have had this issue a few times. It is easy to resolve. Create a fish config file in the below directory, if it doesn't already exist.
Then add the following line to the file.
Once you restart your terminal, the rust commands should work again. |
Exporting in a more fisher way set PATH $HOME/.cargo/bin $PATH in |
An even more fishier way would be to use the fish_user_paths universal variable. Example: No need to mess with config files. A universal variable, once set, is permanently and persistently set across all fish shell sessions. The contents of that variable are automatically prepended to the $PATH environment variable. |
Hi, any update with this, I think it's confusing that the script doesn't even at least mention this issue, nor is it mentioned with the documentation. I believe it's worthwhile to make change in the installation script to correctly handle for fish. |
Unfortunately nobody who works on |
As I commented above, we probably want to solve this is in a way that’s shell-independent. On linux that’d be This will only become more relevant as people start experimenting and depending more with non-POSIX shells such as nushell or powershell. We cannot possibly hope to handle all these different shells in a shell-specific manner. |
Python At least for linux there are some problems with Another, problem is that there seems to be a need to re-login after making changes in ~/.pam_environment, as per following:
|
@kinnison I use Realistically there seems to be only a small handful of non-POSIX shells people actually use, and once support is implemented it probably won't need much in the way of maintenance. |
@icefoxen Hi, I'm glad that you're interested in helping. Just before the holidays, @clearnote01 (I believe) was looking into things, so it may be best to join forces with them. If they've run out of energy for the work, perhaps you might help bring it over the line. |
So any progress? Also why not use |
I believe @workingjubilee is looking at shell support so it's possible Fish may come later from their work. We won't touch |
FYI fish does not read any Source: fish-shell/fish-shell#3665 |
I recommend that because fish sessions are persisted that we detect fish during setup and direct the user to simply run the command which sets PATH appropriately, possibly after writing a fish script to make it easy. |
I would recommend simply running |
I still had some issues even after trying |
fwiw, poetry installation which is also very similar to rustup does it like that as well https://github.com/python-poetry/poetry/blob/cc195f1dd086d1c4d12a3acc8d6766981ba431ac/get-poetry.py#L256 |
I add the $HOME/.cargo/bin in my /etc/paths, it works. |
Create a new fish config file (or use an existing one). Here for example
and add if status --is-login
set -gx PATH $PATH ~/.cargo/bin
end login/logout |
Just want to say that’s not the most fishy of achieving that. You can use the |
setting a path manually should be within the skillset of a fish user. and if not - frankly, they should use bash. |
I don’t think people want this feature because it is too difficult to set the path var. It is the not knowing what to do to fix the issue. If they know they should add to path after install then it should tell the user about it. Things should be obvious so you can service all types of users and not gatekeep because it makes you feel like hackerman. |
This worked for me! Thank you! |
Very much necroing this issue, but I'm trying to figure out what would be the best approach to adding cargo to path. It seems like there are currently three possibilities; Using |
I think that |
Reading through the thread again, the official advice from 2016 was source the env file from ~/.config/fish/conf.d/ from fish shell issue 3170. This makes the removal significantly easier as we can just remove the cargo.fish file from conf.d |
@social-anthrax @DCNick3 Thank you both very much, sorry for the necro, I just realized I never sent my appreciation. |
Any update here? |
Just trying to use fish I have rust, ghcup (for Haskell) that all have their binaries under $HOME `if status is-interactive if status --is-login |
Hello, For fish 3.2.0 or upper, released in March 2021, the easiest way to add rust to path permanently is like that: fish_add_path $HOME/.cargo/bin It will automatically append the specified folder to I hope it helps Would a Rust team maintainer be interested in a pull request that checks the shell used and acts accordingly? Please let me know. |
It's a popular shell and doesn't read
.profile
. cc @nagisa cc #468The text was updated successfully, but these errors were encountered: