If I create a venv on Windows called "py3" then py3/Scripts/Activate.ps1 defines the prompt to be function prompt { Write-Host -NoNewline -ForegroundColor Green [(py3) ] _OLD_VIRTUAL_PROMPT } However this prompt function does not work properly, and running Write-Host -NoNewline -ForegroundColor Green [(py3) ] on its own produces an error because of the lack of quotes around (py3). Adding quotes as shown in the patch seems to fix the problem.