mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
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:
parent
1332226b32
commit
c82dda1e08
7 changed files with 17 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue