bpo-35328: Set VIRTUAL_ENV_PROMPT at venv activation (GH-21587)

Co-Authored-By: Baptiste Darthenay <baptiste.darthenay@gmail.com>
This commit is contained in:
Zackery Spytz 2020-07-28 02:41:57 -06:00 committed by GitHub
parent 1332226b32
commit c82dda1e08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 1 deletions

View file

@ -28,6 +28,7 @@ deactivate () {
fi
unset VIRTUAL_ENV
unset VIRTUAL_ENV_PROMPT
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
@ -56,6 +57,8 @@ if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="__VENV_PROMPT__${PS1:-}"
export PS1
VIRTUAL_ENV_PROMPT="__VENV_PROMPT__"
export VIRTUAL_ENV_PROMPT
fi
# This should detect bash and zsh, which have a hash command that must