You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect PS1 env being set for terminals, duplicated parenthesis #23184
Version v2024.4.0 respects VIRTUAL_ENV_PROMPT, but at the same time tries to put in in (...) , which leads to duplication:
Steps to reproduce:
Install extension
Create a virtual environment using python -m venv .venv
Activate venv using source .venv/bin/activate
Open integrated terminal in VSCode after selecting the newly created venv in Select Interpreter dropdown
I tracked down the problem to getPromptForEnv in src\client\terminals\envCollectionActivation\service.ts, specifically this if statement:
if (interpreter.type===PythonEnvType.Virtual&&env.VIRTUAL_ENV_PROMPT) {
return`(${env.VIRTUAL_ENV_PROMPT}) `;
}
When VIRTUAL_ENV_PROMPT is (.venv) , this results in ((.venv) ) .
Extension version: 2024.4.0
VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:20:17.278Z)
OS version: Windows_NT x64 10.0.22000
Modes:
Remote OS version: Linux x64 5.15.0-100-generic
Remote OS version: Linux x64 5.15.0-100-generic
Remote OS version: Linux x64 5.10.0-20-amd64
Remote OS version: Linux x64 5.15.0-100-generic
I'll add that it seems this version (2024.4.0) does not set the executable bit on the deactivate script which prevents deactivating the environment unless I do
Activity
clnhlzmn commentedon Apr 5, 2024
I'll add that it seems this version (2024.4.0) does not set the executable bit on the deactivate script which prevents deactivating the environment unless I do
This is happening in a remote dev container. Reverting to 2024.2.1 seems to fix this problem and the incorrect prompt.
anthonykim1 commentedon Apr 8, 2024
Thanks for filing issue! PR for the fix is on the way: #23201
Fix duplicated venv prompt (#23201)
karthiknadig commentedon Apr 8, 2024
Duplicate #23193
Fix duplicated venv prompt (microsoft#23201)
Fix duplicated `.venv` prompt parenthesis (#23206)