Skip to content

Commit b744759

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 9dacf43 commit b744759

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
@@ -20,7 +20,6 @@ deactivate () {
2020

2121
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
2222
PS1="${_OLD_VIRTUAL_PS1:-}"
23-
export PS1
2423
unset _OLD_VIRTUAL_PS1
2524
fi
2625

@@ -67,7 +66,6 @@ fi
6766
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
6867
_OLD_VIRTUAL_PS1="${PS1:-}"
6968
PS1="(__VENV_PROMPT__) ${PS1:-}"
70-
export PS1
7169
fi
7270

7371
# 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)