Skip to content

Commit c6ff093

Browse files
authored
Deduplicate shims in $PATH for the fish shell during initialization (#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.
1 parent cc9d5f1 commit c6ff093

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bin/pyenv-virtualenv-init

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ fi
8686
case "$shell" in
8787
fish )
8888
cat <<EOS
89+
while set index (contains -i -- "${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims" \$PATH)
90+
set -eg PATH[\$index]; end; set -e index
8991
set -gx PATH '${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims' \$PATH;
9092
set -gx PYENV_VIRTUALENV_INIT 1;
9193
EOS

0 commit comments

Comments
 (0)