8000 [3.12.11] virtual env shell (ps1) prompt double parentheses around name · Issue #135979 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
[3.12.11] virtual env shell (ps1) prompt double parentheses around name #135979
Closed as duplicate of#132361
@ds-cbo

Description

@ds-cbo

Bug report

Bug description:

Steps to reproduce

$ python3.12 --version
Python 3.12.11

$ python3.12 -m venv /tmp/test

$ cat /tmp/test/bin/activate
...
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
    _OLD_VIRTUAL_PS1="${PS1:-}"
    PS1="("'(test) '") ${PS1:-}"
    export PS1
fi
...

Actual result

((test) ) original prompt here $

The double parentheses look weird.

Expected result

(test) original prompt here $

Workaround

Either disable the automatic prompt-setting with export VIRTUAL_ENV_DISABLE_PROMPT=1 and put an alternative prompt-editing logic in your shell profile

Or modify the bin/activate scripts to remove the extra parentheses manually

CPython versions tested on:

3.12

Operating systems tested on:

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0