diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-01-27 12:41:27 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-01-27 12:41:27 (GMT) |
commit | 3ac504289a93079f2f99d43b51c82153f7b3260a (patch) | |
tree | 2be56e7ed2a64648bb09f12abc4a9552fa2d0f3a /Lib | |
parent | b2a5be0763ee572bed431335eb4712fac94f5a7b (diff) | |
download | cpython-3ac504289a93079f2f99d43b51c82153f7b3260a.zip cpython-3ac504289a93079f2f99d43b51c82153f7b3260a.tar.gz cpython-3ac504289a93079f2f99d43b51c82153f7b3260a.tar.bz2 |
Fixes #29308: Respect VIRTUAL_ENV_DISABLE_PROMPT in Activate.ps1.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/venv/scripts/nt/Activate.ps1 | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Lib/venv/scripts/nt/Activate.ps1 b/Lib/venv/scripts/nt/Activate.ps1 index b15decb..c22b1ea 100644 --- a/Lib/venv/scripts/nt/Activate.ps1 +++ b/Lib/venv/scripts/nt/Activate.ps1 @@ -29,13 +29,15 @@ deactivate -nondestructive $env:VIRTUAL_ENV="__VENV_DIR__"
-# Set the prompt to include the env name
-# Make sure _OLD_VIRTUAL_PROMPT is global
-function global:_OLD_VIRTUAL_PROMPT {""}
-copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
-function global:prompt {
- Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'
- _OLD_VIRTUAL_PROMPT
+if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) {
+ # Set the prompt to include the env name
+ # Make sure _OLD_VIRTUAL_PROMPT is global
+ function global:_OLD_VIRTUAL_PROMPT {""}
+ copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
+ function global:prompt {
+ Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'
+ _OLD_VIRTUAL_PROMPT
+ }
}
# Clear PYTHONHOME
|