gh-89427: Provide the original prompt value for VIRTUAL_ENV_PROMPT#106726
Merged
vsajip merged 1 commit intopython:mainfrom Jan 23, 2024
jimporter:gh-89427/no-parens-around-virtual-env-prompt
Merged
gh-89427: Provide the original prompt value for VIRTUAL_ENV_PROMPT#106726vsajip merged 1 commit intopython:mainfrom jimporter:gh-89427/no-parens-around-virtual-env-prompt
vsajip merged 1 commit intopython:mainfrom
jimporter:gh-89427/no-parens-around-virtual-env-prompt
Conversation
Contributor
Author
|
@vsajip Is there anything else I should do with this patch before it merges? This change will keep venv's behavior in-sync with virtualenv (see pypa/virtualenv#2606). |
Member
|
Sorry, not had time to review this. Hope to get to it soon. |
Contributor
Author
No problem! Just wanted to make sure you weren't waiting on me for something. |
Contributor
Author
|
@vsajip I rebased this and fixed the merge conflicts, which had the nice benefit of actually making the diff smaller. |
This improves the implementation in gh-106643. Previously, venv passed "(<prompt>) " to the activation scripts, but we want to provide the original value so that users can inspect it in the $VIRTUAL_ENV_PROMPT env var. Note: Lib/venv/scripts/common/Activate.ps1 surrounded the prompt value with parens a second time, so no change was necessary in that file.
Contributor
Author
|
@vsajip Just checking again to see if you have bandwidth to review. I rebased again so it should merge cleanly. |
vsajip
approved these changes
Jan 23, 2024
aisk
pushed a commit
to aisk/cpython
that referenced
this pull request
Feb 11, 2024
…MPT (pythonGH-106726) This improves the implementation in pythongh-106643. Previously, venv passed "(<prompt>) " to the activation scripts, but we want to provide the original value so that users can inspect it in the $VIRTUAL_ENV_PROMPT env var. Note: Lib/venv/scripts/common/Activate.ps1 surrounded the prompt value with parens a second time, so no change was necessary in that file.
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this pull request
Sep 2, 2024
…MPT (pythonGH-106726) This improves the implementation in pythongh-106643. Previously, venv passed "(<prompt>) " to the activation scripts, but we want to provide the original value so that users can inspect it in the $VIRTUAL_ENV_PROMPT env var. Note: Lib/venv/scripts/common/Activate.ps1 surrounded the prompt value with parens a second time, so no change was necessary in that file.
artizirk
added a commit
to artizirk/dotfiles
that referenced
this pull request
Oct 29, 2024
And ignore VIRTUAL_ENV_PROMPT variable for now as it is different between venv and virtualenv implementations: * python/cpython#106726 * pypa/virtualenv#2606
NiLuJe
added a commit
to 16arpi/fouille-texte-2025
that referenced
this pull request
Apr 28, 2025
Prompts are weird as hell since python/cpython#106726 landed...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This improves the implementation in gh-106643.
Previously, venv passed
"(<prompt>) "to the activation scripts, but we want to provide the original value so that users can inspect it in the$VIRTUAL_ENV_PROMPTenv var.Note: Lib/venv/scripts/common/Activate.ps1 surrounded the prompt value with parens a second time, so no change was necessary in that file.
Sorry for the noise; I didn't quite understand the flow of this code until I started comparing it more closely to the implementation in the
virtualenvpackage.I was careful to test this change in action (only using the Bash version of the activation script, since that's the shell I have), but I also checked the generated scripts and they all look correct to me. After calling
python -m venv foobar(results are also as expected if I pass--prompt=something):activate
activate.csh
activate.fish