-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
OS-macstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-venvRelated to the venv moduleRelated to the venv moduletype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
When I create and activate a virtual environment using python -m venv myenv on macOS, the terminal prompt initially displays (myenv) correctly. However, after exiting VSCode and reopening it, the parentheses disappear, even though the virtual environment is still active. If activated again, an extra set of parentheses is added.
The default PS1 setting in activate: PS1="("myenv") ${PS1:-}"
should be corrected to: PS1="(myenv) ${PS1:-}"
as the extra quotes cause formatting issues.
Expected behavior:
The prompt should be (myenv) user@MacBook ~ %, but instead appears as myenvuser@MacBook ~ %.
Suggested fix:
Remove unnecessary quotes around "myenv" in the activate script.


CPython versions tested on:
3.13
Operating systems tested on:
macOS
Metadata
Metadata
Assignees
Labels
OS-macstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-venvRelated to the venv moduleRelated to the venv moduletype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error