Skip to content

Commit 2da9351

Browse files
committed
gh-111501: Do not export PS1 in venv activate
PS1 is a parameter special to the current interactive shell. It does not need to be exported to the environment. Exporting PS1 is not useful, and will break different shells spawned by the current interactive shell.
1 parent 6544bf4 commit 2da9351

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/venv/scripts/common/activate

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ deactivate () {
2121

2222
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
2323
PS1="${_OLD_VIRTUAL_PS1:-}"
24-
export PS1
2524
unset _OLD_VIRTUAL_PS1
2625
fi
2726

@@ -68,7 +67,6 @@ fi
6867
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
6968
_OLD_VIRTUAL_PS1="${PS1:-}"
7069
PS1="("__VENV_PROMPT__") ${PS1:-}"
71-
export PS1
7270
fi
7371

7472
# Call hash to forget past commands. Without forgetting
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PS1 is no longer exported by venv activate script

0 commit comments

Comments
 (0)