Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicated venv prompt parenthesis #23201

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

anthonykim1
Copy link

@anthonykim1 anthonykim1 commented Apr 8, 2024

Resolves: #23193 #23184

Resolve duplicated (.venv) prompt for users terminal.
Issue came from: #23080

@anthonykim1 anthonykim1 self-assigned this Apr 8, 2024
@anthonykim1 anthonykim1 added area-terminal bug Issue identified by VS Code Team member as probable bug labels Apr 8, 2024
@anthonykim1 anthonykim1 marked this pull request as ready for review April 8, 2024 17:38
@anthonykim1 anthonykim1 added the skip tests Updates to tests unnecessary label Apr 8, 2024
@anthonykim1 anthonykim1 merged commit eed0c3b into microsoft:main Apr 8, 2024
37 of 41 checks passed
@karthiknadig karthiknadig changed the title Fix duplicated venv prompt Fix duplicated venv prompt parenthesis Apr 8, 2024
anthonykim1 added a commit to anthonykim1/vscode-python that referenced this pull request Apr 9, 2024
Resolves: microsoft#23193 microsoft#23184

Resolve duplicated (.venv) prompt for users terminal.
Issue came from: microsoft#23080
wesm pushed a commit to posit-dev/positron that referenced this pull request May 10, 2024
seeM pushed a commit to posit-dev/positron that referenced this pull request May 12, 2024
wesm pushed a commit to posit-dev/positron that referenced this pull request May 13, 2024
@AddisonG
Copy link

AddisonG commented Sep 8, 2024

Not sure if I'm just unlucky, but my Mac setup with work, and Ubuntu setup at home, for 2 different projects, are both missing the parenthesis now. So I now get:

venvaddison:~/tmp

Instead of:

(venv) addison:~/tmp

I have no idea if this is related to this issue, but it sure looks like it is.

Python3.13, vscode: 1.93.0, Microsoft Python Extension: v2024.14.0


EDIT:

Ahh yes, I see. VIRTUAL_ENV_PROMPT (within the venv/bin/activate script) is no longer set to include parenthesis in new python versions. But nobody seems to realise that, as they're using old versions of python. I might be the first to realise, since I cannot for the life of me find anything on the internet about this.

This appears to be stemming from a lack of communication or understanding between those 2 projects. Or perhaps I'm extremely misguided, and rambling like a fool.

To fix this, you can add this to your settings JSON:

"python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"],

And then do a hard reload of vscode.

See also my SO post

@Chrisguagliano
Copy link
Member

@AddisonG THANK YOU! This has been bugging me for months and never looked into it.

@Chrisguagliano
Copy link
Member

Chrisguagliano commented Sep 11, 2024

@Tyriar the issue that Addison and myself are experiencing might be VSCode related. If I make the update that Addison mentioned, VSCode terminal correctly shows (.venv) but a standard terminal shows double parentheses ((.venv) ) . I am on Ubuntu 22.04, Python 3.10.12, VSCode 1.93.0.

The issue persists on WSL, as well.

@AddisonG
Copy link

AddisonG commented Sep 11, 2024

You're right. I actually didn't check the fix in a normal terminal. It's not related to that file, but that's a hack to fix it.

Good to know someone else is having this issue, not just me. We can suffer together!

I made a ticket, since now I know I'm not going crazy:
#24097

I'm now pretty confident that this is a Vscode problem - not venv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug skip tests Updates to tests unnecessary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double parantheses: "((.venv) )"
4 participants