Fixes #29308: Respect VIRTUAL_ENV_DISABLE_PROMPT in Activate.ps1.

This commit is contained in:
Vinay Sajip 2017-01-27 12:41:27 +00:00
parent b2a5be0763
commit 3ac504289a
1 changed files with 9 additions and 7 deletions

View File

@ -29,13 +29,15 @@ deactivate -nondestructive
$env:VIRTUAL_ENV="__VENV_DIR__" $env:VIRTUAL_ENV="__VENV_DIR__"
# Set the prompt to include the env name if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) {
# Make sure _OLD_VIRTUAL_PROMPT is global # Set the prompt to include the env name
function global:_OLD_VIRTUAL_PROMPT {""} # Make sure _OLD_VIRTUAL_PROMPT is global
copy-item function:prompt function:_OLD_VIRTUAL_PROMPT function global:_OLD_VIRTUAL_PROMPT {""}
function global:prompt { copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__' function global:prompt {
_OLD_VIRTUAL_PROMPT Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'
_OLD_VIRTUAL_PROMPT
}
} }
# Clear PYTHONHOME # Clear PYTHONHOME