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

Setting to show (venv) in terminal anyways #22917

Closed
a-Datana opened this issue Feb 15, 2024 · 14 comments
Closed

Setting to show (venv) in terminal anyways #22917

a-Datana opened this issue Feb 15, 2024 · 14 comments
Labels
area-terminal feature-request Request for new features or functionality needs community feedback Awaiting community feedback

Comments

@a-Datana
Copy link

a-Datana commented Feb 15, 2024

i think the title is pretty self explanatory.

since the last vscode update vs code hides the (venv) or (virual enviroment name here) text in the terminal, which is a small thing but still brought up issues cause trusting it does sometimes mean installing packages globally.
which is suboptimal.

i'd like an option which shows that indicator again.

image

@a-Datana a-Datana added the feature-request Request for new features or functionality label Feb 15, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 15, 2024
@nickdalts
Copy link

This was driving me crazy

@austinwitherspoon
Copy link

This is also beneficial if you have multiple virtual environments, since it used to show the name of the virtual environment you were actively in (if they have different names), and remind you if you needed to close that terminal and reopen.

@bigalnz
Copy link

bigalnz commented Feb 20, 2024

+1 - removing that is not a helpful feature.

@karrtikr
Copy link

karrtikr commented Feb 20, 2024

Hi all, please note the inability to show (venv) is a limitation rather than a feature, of the new way of activating environments via environment variables. If you click "Learn more", it should have more details: link.

The limitation comes from VS Code and Powershell itself, as none of them provide us with an environment variable that we can set to change the terminal prompt.

Interested folks can try using "Command prompt" shell instead, use Select default profile to change the shell, which should have the (venv).

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 20, 2024
@bigalnz
Copy link

bigalnz commented Feb 20, 2024 via email

@karrtikr
Copy link

@bigalnz Git bash is not supported by the Python extension currently.

@bigalnz
Copy link

bigalnz commented Feb 20, 2024

So this auto activation of the terminal is a feature of the Python plugin - not native VSCode?

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Feb 20, 2024
@bigalnz
Copy link

bigalnz commented Feb 20, 2024

A question on So here may also be worth voting for to get coverage on this question : https://stackoverflow.com/questions/78005138/make-venv-default-terminal-for-project-in-vscode/78030464#78030464

@karrtikr
Copy link

I'm changing this to a feature request, and if it gets enough upvotes, maybe VS Code can consider us giving us such a feature: #22917 (comment).

@karrtikr karrtikr added area-terminal needs community feedback Awaiting community feedback and removed triage-needed Needs assignment to the proper sub-team labels Feb 26, 2024
@karrtikr karrtikr removed their assignment Feb 26, 2024
Copy link

Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.

@karrtikr karrtikr changed the title Setting to show (venv) in terminal anyways. Setting to show (venv) in terminal anyways Feb 26, 2024
@kyrlon
Copy link

kyrlon commented Mar 1, 2024

So this auto activation of the terminal is a feature of the Python plugin - not native VSCode?

Issue #23008 has gifs showing an old extension version activating all 3 on windows 10

@kyrlon
Copy link

kyrlon commented Mar 3, 2024

This is also beneficial if you have multiple virtual environments, since it used to show the name of the virtual environment you were actively in (if they have different names), and remind you if you needed to close that terminal and reopen.

I often use the python launcher py and if the terminal is not actively stating its virtual environemnt , my modules are installed global instead unfortunately.

@martinandrovich
Copy link

I was looking for this because my Git Bash terminal was not sourcing my Python venv (and the text didn't show even though it was sourced). For anyone else looking, the fix was to add this to .bashrc:

[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path bash)"

read more about it here and here.

@brettcannon
Copy link
Member

I'm going to close this in favour of #22611 which would bring back the old solution as at least an option. You can also opt out of the experiment if you want.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Jun 25, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-terminal feature-request Request for new features or functionality needs community feedback Awaiting community feedback
Projects
None yet
Development

No branches or pull requests

8 participants