This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: venv's Activate.ps1 causes broken prompt with powershell
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: python-dev, sbt, vinay.sajip
Priority: normal Keywords: patch

Created on 2012-07-15 19:02 by sbt, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
prompt.patch sbt, 2012-07-15 19:02 review
Messages (2)
msg165545 - (view) Author: Richard Oudkerk (sbt) * (Python committer) Date: 2012-07-15 19:02
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.
msg165549 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-07-15 20:58
New changeset 0b4d0c2173ad by Vinay Sajip in branch 'default':
Closes #15361: Corrected venv prompt in PowerShell activation script.
http://hg.python.org/cpython/rev/0b4d0c2173ad
History
Date User Action Args
2022-04-11 14:57:32adminsetgithub: 59566
2012-07-15 20:58:23python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg165549

resolution: fixed
stage: patch review -> resolved
2012-07-15 19:02:39sbtcreate