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

Terminal indicates that (base) is activated for virtual environments in powershell #21903

Closed
karrtikr opened this issue Aug 30, 2023 · 1 comment
Assignees
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug

Comments

@karrtikr
Copy link

karrtikr commented Aug 30, 2023

Testing #21298

  • conda init powershell script configures conda to automatically activate (base) environment in powershell.
  • Powershell itself does not have a shell specific variable we can change to influence the shell prompt.
  • For conda environments though, conda init itself embeds a CONDA_PROMPT_MODIFIER variable into the powershell init script, which we can influence to change the prompt 😀
  • For virtual environments, no such initialization is done hence this is what currently appears when opening a new terminal 🙁

image

In that case I'm hoping the learn more docs: https://github.com/microsoft/vscode-python/wiki/Activate-Environments-in-Terminal-Using-Environment-Variables could clarify it.

@karrtikr karrtikr added bug Issue identified by VS Code Team member as probable bug area-terminal needs spike Label for issues that need investigation before they can be worked on. labels Aug 30, 2023
@karrtikr karrtikr added this to the September 2023 milestone Aug 30, 2023
@karrtikr karrtikr self-assigned this Aug 30, 2023
@karrtikr
Copy link
Author

karrtikr commented Aug 30, 2023

One hack we could've done was that for virtual environments, we use the CONDA_PROMPT_MODIFIER variable itself to set the prompt.

But we had a team discussion about this, and decided that the situation where users are using both conda and virtual environments is probably rare, so let's not preemptively add this hack. We can add it later based on feedback if there's confusion.

Closing as designed.

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2023
@karrtikr karrtikr removed this from the September 2023 milestone Aug 30, 2023
@github-actions github-actions bot removed the needs spike Label for issues that need investigation before they can be worked on. label Aug 30, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

1 participant