diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-01-27 12:42:45 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-01-27 12:42:45 (GMT) |
commit | dbb5686e7e20355a452e91132e4174c2a4ea84b6 (patch) | |
tree | 95273e707554ba2af336d89f7742386c24ae3dce | |
parent | ae28ffd944a584e2b415a4ef52daf4e46c5b8a81 (diff) | |
parent | 3ac504289a93079f2f99d43b51c82153f7b3260a (diff) | |
download | cpython-dbb5686e7e20355a452e91132e4174c2a4ea84b6.zip cpython-dbb5686e7e20355a452e91132e4174c2a4ea84b6.tar.gz cpython-dbb5686e7e20355a452e91132e4174c2a4ea84b6.tar.bz2 |
Fixes #29308: Merged fix from 3.5.
-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
|