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.

Author brett.cannon
Recipients brett.cannon, vinay.sajip
Date 2019-07-23.20:41:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1563914466.51.0.723098783517.issue37663@roundup.psfhosted.org>
In-reply-to
Content
There are five activation scripts and they are all do things differently when it comes to prompt manipulation. Standardizing on one set of semantics would probably be good for consistency and so people know what to expect regardless of their shell.

Currently the various semantics are as follows (see subdirectories in https://github.com/python/cpython/tree/master/Lib/venv/scripts for the code):

- PowerShell: use __VENV_PROMPT__, make it green
- bash: use __VENV_PROMPT__ if defined (which is nearly true; bpo-37661), else if virtual env in a directory named "__" (for some defunked software named Aspen; bpo-37660) then use "[dir]", else "(dir)"
- Command Prompt: use __VENV_PROMPT__
- csh: use __VENV_NAME__ if defined, else calculate name and use "[dir]"
- fish: same as bash, except if not using __VENV_PROMPT__ then use white text on a blue background

So the variances/questions are:
1. Always use __VENV_PROMPT__ and don't bother testing? (bpo-37661 suggests we should, or else come up with a new way to tell whether a custom prompt was provided)
2. Always use colour regardless of whether the prompt is custom? (I vote "yes"; don't care about what the colours happen to be)
3. Parentheses or square brackets? (Due to bpo-37661 I vote for parentheses since that's what people are used to)
History
Date User Action Args
2019-07-23 20:41:06brett.cannonsetrecipients: + brett.cannon, vinay.sajip
2019-07-23 20:41:06brett.cannonsetmessageid: <1563914466.51.0.723098783517.issue37663@roundup.psfhosted.org>
2019-07-23 20:41:06brett.cannonlinkissue37663 messages
2019-07-23 20:41:05brett.cannoncreate