Run the fish prompt only when PWD/PYENV_VERSION changes

This commit is contained in:
Harish Rajagopal 2023-03-04 16:40:43 +01:00
parent 13bc1877ef
commit 41f2b93fc8
No known key found for this signature in database
GPG key ID: 6D3F9FC446023F9C

View file

@ -104,7 +104,7 @@ esac
case "$shell" in
fish )
cat <<EOS
function _pyenv_virtualenv_hook --on-event fish_prompt;
function _pyenv_virtualenv_hook --on-variable PWD --on-variable PYENV_VERSION;
set -l ret \$status
if [ -n "\$VIRTUAL_ENV" ]
pyenv activate --quiet; or pyenv deactivate --quiet; or true
@ -113,6 +113,7 @@ function _pyenv_virtualenv_hook --on-event fish_prompt;
end
return \$ret
end
_pyenv_virtualenv_hook
EOS
;;
ksh )