allow users to configure prompt add-on

This commit is contained in:
Jovier A. Jiménez
2024-02-19 21:18:56 -08:00
parent 0f83c33a3b
commit 9f3afd0cfb

View File

@@ -262,9 +262,14 @@ EOS
fi fi
;; ;;
* ) * )
if [ -z "${PYENV_VIRTUALENV_PROMPT}" ]; then
PYENV_VIRTUALENV_PROMPT="(${venv})"
else
PYENV_VIRTUALENV_PROMPT="${PYENV_VIRTUALENV_PROMPT/\{venv\}/${venv}}"
fi
cat <<EOS cat <<EOS
export _OLD_VIRTUAL_PS1="\${PS1:-}"; export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(${venv}) \${PS1:-}"; export PS1="${PYENV_VIRTUALENV_PROMPT} \${PS1:-}";
EOS EOS
;; ;;
esac esac