Skip to content

Command prompt does not respect VIRTUAL_ENV_DISABLE_PROMPT when activating venv #109940

Closed

Activity

  1. added
    type-bug
    on Sep 27, 2023
  2. added
    stdlib
    topic-venv
    on Nov 28, 2023
  3. gaborbernat commented on Jun 5, 2026

    @gaborbernat
    Contributor

    Confirmed, still present on main: activate.bat sets PROMPT=(...) %PROMPT% unconditionally, with no VIRTUAL_ENV_DISABLE_PROMPT check, so on Windows cmd the prefix is added regardless of the variable. It's the only CPython activator that ignores it — bash/zsh, fish, csh, and Activate.ps1 all gate the prompt on it.

    virtualenv's batch activator gates both the prompt save and the prompt change on if not defined VIRTUAL_ENV_DISABLE_PROMPT (activate.bat L21-27). Wrapping the _OLD_VIRTUAL_PROMPT save and the PROMPT= line in the same check would fix it.

  4. added 3 commits that reference this issue on Jun 10, 2026
  5. added 4 commits that reference this issue on Jun 10, 2026
  6. added a commit that references this issue on Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibtopic-venvtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions