Skip to content

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

Description

@karrtikr

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.

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    needs spikeLabel for issues that need investigation before they can be worked on.
    on Aug 30, 2023
  2. karrtikr commented on Aug 30, 2023

    @karrtikr
    Author

    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.

  3. removed
    needs spikeLabel for issues that need investigation before they can be worked on.
    on Aug 30, 2023
  4. locked as resolved and limited conversation to collaborators on Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-terminalbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions