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

eval (opam env) in fish shell adds . to $HOME #4418

Closed
goderich opened this issue Nov 5, 2020 · 3 comments · Fixed by #4084
Closed

eval (opam env) in fish shell adds . to $HOME #4418

goderich opened this issue Nov 5, 2020 · 3 comments · Fixed by #4084

Comments

@goderich
Copy link

goderich commented Nov 5, 2020

I've had this happen on two separate computers, and I believe I know the root cause of the issue. Running opam env in fish shell gives the following output:

(...other stuff...)
set -gx PATH ':/home/goderich/.opam/ocaml-system.4.11.1/bin' '/home/goderich/.local/bin' '/home/goderich/.emacs.d/bin' '/home/goderich/.bin' '/home/goderich/.config/bspwm/panel' '/home/goderich/.poetry/bin' '/usr/local/sbin' '/usr/local/bin' '/usr/bin/core_perl' '/usr/bin' '/usr/lib/jvm/default/bin' '/home/goderich/.local/bin';

It is that : at the beginning of the first argument that adds . to the environment. Running the command several times adds it as many times. Removing the colon gets rid of the problem (and removes already existing . from $PATH).

I think the colon is needed on POSIX shells (I'm not sure), while in fish it is not only unnecessary, but actively harmful. Having . in my $PATH led me on a merry bug chase for several days when trying to install Emacs from source.

@rjbou
Copy link
Collaborator

rjbou commented Nov 5, 2020

Is it the same problem than in #4403 ?
What is the version of opam you use ?

@goderich
Copy link
Author

goderich commented Nov 5, 2020

Oh my, I should have searched more thoroughly. That is indeed the same problem. I am on version 2.0.7 right now, I'll make sure to upgrade pronto. Thank you for the reply, I'm closing this (non-)issue.

@goderich goderich closed this as completed Nov 5, 2020
@rjbou
Copy link
Collaborator

rjbou commented Nov 5, 2020

2.1.0 is not release (in beta versions), but i'll backport the fish fix in the next 2.0.8. Stay tuned for this one then ;)

@rjbou rjbou linked a pull request Feb 4, 2021 that will close this issue
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