Repository navigation
Terminal PS1 Doubles with venv #22056
Copy link
Copy link
Closed
Labels
area-terminalauthor-verification-requestedIssues potentially verifiable by issue authorIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugexperimentingFeature is part of an experimentFeature is part of an experimentverifiedVerification succeededVerification succeeded
Milestone
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.82.2
- OS Version: Fedora 38 workstation
Terminal's PS1 doubles every time I create and activate python venv.

My PS1 changes from
(venv) [nikolay@fedora techfluencer] (Nikolay)$ to
(venv) [nikolay@fedora techfluencer] (Nikolay)$ [nikolay@fedora techfluencer] (Nikolay)$ BUT : Upper example without activated venv
With activated venv:
(venv) (venv) [nikolay@fedora techfluencer] (Nikolay)$ [nikolay@fedora techfluencer] (Nikolay)$ If I open the system terminal and activate the virtual environment, PS1 does not change.
I tried to delete all user's settings, delete all extensions, but it still doubles. 3 month on this OS build + vscode, all was ok but 1 week ago this bug appeared. After doubling you can deactivate venv, close vscode, open again and PS1 will be still doubled. Delete venv folder, close vscode, open again, re-open project folder and maybe it will be single.
extensions
- cweijan.vscode-postgresql-client2
- dsznajder.es7-react-js-snippets
- Equinusocio.vsc-community-material-theme
- Equinusocio.vsc-material-theme
- equinusocio.vsc-material-theme-icons
- ms-azuretools.vscode-docker
- ms-python.autopep8
- ms-python.python
- ms-python.vscode-pylance
- ms-vscode-remote.remote-containers
- PKief.material-icon-theme
- qwtel.sqlite-viewer
- ritwickdey.LiveServer
- shd101wyy.markdown-preview-enhanced
- TabNine.tabnine-vscode
- xabikos.JavaScriptSnippets
Metadata
Metadata
Assignees
Labels
area-terminalauthor-verification-requestedIssues potentially verifiable by issue authorIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugexperimentingFeature is part of an experimentFeature is part of an experimentverifiedVerification succeededVerification succeeded
Activity
kolaxy commentedon Sep 22, 2023
Code version
1.82.2
abd2f3db4bdb28f9e95536dfa84d8479f1eb312d
x64
User settings
{ "window.titleBarStyle": "custom", "workbench.colorTheme": "Material Theme Ocean", "workbench.iconTheme": "material-icon-theme", "files.autoSave": "afterDelay", "[python]": { "editor.defaultFormatter": "ms-python.autopep8" }, "workbench.colorCustomizations": { "terminal.findMatchBackground": "#aaaaaa6e" }, "window.commandCenter": false, "tabnine.experimentalAutoImports": true, "terminal.integrated.gpuAcceleration": "off" }karrtikr commentedon Sep 22, 2023
Apologies for the trouble, could you provide us the debug logs? It'll help identify the issue:
Developer: Set log levelcommandTraceDeveloper: Reload WindowcommandOutput for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)Dup #22044
kolaxy commentedon Sep 23, 2023
I've deleted my variables from .env file
Output for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)karrtikr commentedon Sep 23, 2023
Thanks, could you hover over the terminal name and click show environment contributions?

And send the contents of the file opened here, it would appear something like:

16 remaining items
karrtikr commentedon Sep 25, 2023
Nikolay (@kolaxy), Problem was related to this feature which is currently behind an experiment: https://code.visualstudio.com/updates/v1_82#_terminal-activation-using-environment-variables
It should now be fixed with #22078 without the need for #22056 (comment), please install the vsix using
Install from VSIXcommand.Relaunching the terminal as indicated in the hover should make the warning go away.
karrtikr commentedon Sep 25, 2023
Alternatively, fix should be out in the pre-release version of the extension in a day, use the following to try it out:
Calculate PS1 instead of using PS1 returned by shell (#22078)
Calculate PS1 instead of using PS1 returned by shell (microsoft#22078)
Merged PR posit-dev/positron-python#224: Merge/2023.18
Merged PR posit-dev/positron-python#224: Merge/2023.18