Skip to content

Commit

Permalink
Deduplicate shims in $PATH for the fish shell during initialization (#…
Browse files Browse the repository at this point in the history
…430)

When a fish login shell is invoked within an existing login shell, avoid
duplicating path to the shims by removing existing occurrences before
prepending.
  • Loading branch information
ericvw authored May 19, 2022
1 parent cc9d5f1 commit c6ff093
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/pyenv-virtualenv-init
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ fi
case "$shell" in
fish )
cat <<EOS
while set index (contains -i -- "${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims" \$PATH)
set -eg PATH[\$index]; end; set -e index
set -gx PATH '${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims' \$PATH;
set -gx PYENV_VIRTUALENV_INIT 1;
EOS
Expand Down

0 comments on commit c6ff093

Please sign in to comment.