Skip to content

Filter .*\( and \).* in VENV if it is present#30

Open
Niapoll wants to merge 1 commit into
Moarram:mainfrom
Niapollab:main
Open

Filter .*\( and \).* in VENV if it is present#30
Niapoll wants to merge 1 commit into
Moarram:mainfrom
Niapollab:main

Conversation

@Niapoll

@Niapoll Niapoll commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

When I activate a Python virtual environment created with the venv module, I expect to see:
Снимок экрана 2025-10-22 в 20 20 02
but instead I get:
Снимок экрана 2025-10-22 в 20 19 01
This change removes any characters and brackets (if present) that should appear in the prompt

@Moenupa

Moenupa commented Nov 4, 2025

Copy link
Copy Markdown

#29 Which python venv manager are you using? This may need re-arranging fallback order of env vars to read from. (e.g. a different var). This seems to me a bit of hard code.

@Niapoll

Niapoll commented Nov 6, 2025

Copy link
Copy Markdown
Contributor Author

I use the venv module for Python on macOS. It seems that in some versions of Python/venv, it's normal for the shell prompt to include something like (.venv) .

I agree it can look a bit messy. Maybe we can separate or format it more clearly using custom prompt expressions

@Moenupa

Moenupa commented Nov 15, 2025

Copy link
Copy Markdown

It is strange that I could not reproduce this error you mentioned.

VIRTUAL_ENV            -- /project_name/env
VIRTUAL_ENV_PROMPT     -- env

using Python 3.14, python3.14 -m venv env, my prompt gives a normal user @ device (env): /project_name

@Niapoll

Niapoll commented Nov 18, 2025

Copy link
Copy Markdown
Contributor Author

It is strange that I could not reproduce this error you mentioned.

VIRTUAL_ENV            -- /project_name/env
VIRTUAL_ENV_PROMPT     -- env

using Python 3.14, python3.14 -m venv env, my prompt gives a normal user @ device (env): /project_name

I ran a quick check using pyenv 2.6.12 on ubuntu@sha256:c35e29c9450151419d9448b0fd75374fec4fff364a27f176fb458d472dfc9e54 to see how different Python versions (using the standard library venv module) set or omit VIRTUAL_ENV_PROMPT:

Python 3.8.20

No VIRTUAL_ENV_PROMPT variable.

Python 3.9.25

No VIRTUAL_ENV_PROMPT variable.

Python 3.10.19

.venv/bin/activate:60: VIRTUAL_ENV_PROMPT='(.venv) '

Python 3.11.14

.venv/bin/activate:57: VIRTUAL_ENV_PROMPT='(.venv) '

Python 3.12.12

.venv/bin/activate:57:VIRTUAL_ENV_PROMPT='(.venv) '

Python 3.13.9

.venv/bin/activate:57:VIRTUAL_ENV_PROMPT=.venv

Python 3.14.0

.venv/bin/activate:57:VIRTUAL_ENV_PROMPT=.venv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants