-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Summary
I have several fully functioning projects, each with their own venv.
Randomly, and unpredictably, they will sometimes become afflicted by a curse which causes the PS1 bash prompt to display wrong:
What it should be
(venv) addison@home ~/tmp $:
^^^^^^ Looks good!
What I get:
venvaddison@home ~/tmp $:
^^^^ Yuck!
Description
This is a pain to reproduce on Mac, and I have not managed to reliably get a minimal reproduction case, but I have a repro on Ubuntu (documented here).
It seems that the issue is caused (maybe?) on MacOS by just being
/Users/addison/work/allprojects.code-workspace:
{
"folders": [
{
# This project dir is right beside the workspace file - it has a relative path
"path": "my-working-project"
},
{
# This project uses an absolute path - it breaks
"path": "/Users/addison/other/my-BROKEN-project"
},
{
# This also breaks, just in case you were going to ask
"path": "../other/my-BROKEN-project"
},
...
I'm pretty sure that just moving the project into a different dir works, except that you have to re-generate the venv, as it contains absolute paths.
I can confirm that this is unrelated, to the venv/bin/activate being different between "broken" folders in a workspace.
These files are identical in every way (except for the line: VIRTUAL_ENV=/different/path/for/each/project) when comparing a broken folder which exhibits this behaviour (venvusername), and a functioning folder which does not ((venv) username).
Environment and Versions
This happens on Mac and Linux (and probably also Windows, but unconfirmed)
- Ubuntu 24.04, Python3.13, vscode: 1.93.0, Microsoft Python Extension: v2024.14.0
- Darwin arm64 22.6.0, vscode: 1.92.2 (Universal), Microsoft Python Extension: v2024.14.0
- Difficult to reproduce on Mac. Definitely still happens - and seems to relate to the Python version
- Seems to sometimes be related to the import path of the dir into the vscode project
Python 3.9, 3.10 and 3.13 - probably all versions?
Links
This is the PR I believe caused this issue, or may be related to it in some capacity.
#23201
Here is a stack overflow post I made, about the same thing:
https://stackoverflow.com/questions/78961614/vscode-ps1-missing-parenthesis-around-venv