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

Fish config.fish: adding source (jenv init -| psub) causes shims dir to be added to path twice #409

Open
aholland opened this issue Jun 20, 2023 · 1 comment

Comments

@aholland
Copy link

I have changed the initialisation line in my config.fish file from
source (jenv init -|psub)
to
source (jenv init -| tail -n +2 | psub)
to prevent ~/.jenv/shims from being added to my path twice.

As soon as jenv is called it adds the dir to the path, and then the first line produced by jenv init - does it again. Here is the output of jenv init -:

set -gx PATH '/Users/anthonyholland/.jenv/shims' $PATH
set -gx JENV_SHELL fish
set -gx JENV_LOADED 1
set -e JAVA_HOME
set -e JDK_HOME
source '/opt/homebrew/Cellar/jenv/0.5.6/libexec/libexec/../completions/jenv.fish'
jenv rehash 2>/dev/null
jenv refresh-plugins
function jenv
  set command $argv[1]
  set -e argv[1]

  switch "$command"
  case enable-plugin rehash shell shell-options
    jenv "sh-$command" $argv | source
  case '*'
    command jenv "$command" $argv
  end
end
@infotexture
Copy link

@aholland Thanks for this fix. The duplicate $PATH entry had been bugging me too.

Might be good to submit a PR to get this corrected in the README.

Also wonder if those instructions should use fish_add_path instead, which might also help to prevent the duplicates. 🤔

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