8000 bpo-37663: have venv activation scripts all consistently use __VENV_PROMPT__ for prompt customization by brettcannon · Pull Request #14941 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-37663: have venv activation scripts all consi 8000 stently use __VENV_PROMPT__ for prompt customization #14941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 21, 2019

Conversation

brettcannon
Copy link
Member
@brettcannon brettcannon commented Jul 24, 2019

The activation scripts generated by venv were inconsistent in how they changed the shell's prompt. Some used __VENV_PROMPT__ exclusively, some used __VENV_PROMPT__ if it was set although by default __VENV_PROMPT__ is always set and the fallback matched the default, and one ignored __VENV_PROMPT__ and used __VENV_NAME__ instead (and even used a differing format to the default prompt). This change now has all activation scripts use __VENV_PROMPT__ only and relies on the fact that venv sets that value by default.

The color of the customization is also now set in fish to the blue from the Python logo for as hex color support is built into that shell (much like PowerShell where the built-in green color is used).

https://bugs.python.org/issue37663

@brettcannon
Copy link
Member Author

/cc @mental32

Copy link
Contributor
@mental32 mental32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cc'ing :)

Changes look good to me!

I'm curious about the special casing of "aspen magic directories" would you know anything about these? the link seems to point to a broken site.

Also I noticed you made typo changes, can I assume that'd be alright to do? (in case I catch an issue that needs a patch and a tidy up)

@brettcannon
Copy link
Member Author

@mental32 I have no clue about them and since the URL is dead and the site seems to now be a news site I figured it wasn't worth keeping the code around.

And yes, you can always touch up typos and such in comments if you come across them while working on code. The only reason I touched up the punctuation for the whole fish file was it's small enough to not be horribly distracting in the PR.

@brettcannon brettcannon closed this Aug 1, 2019
@brettcannon brettcannon deleted the simplify-venv branch August 1, 2019 22:25
@brettcannon brettcannon reopened this Aug 3, 2019
@brettcannon brettcannon requested a review from vsajip August 3, 2019 00:07
@brettcannon brettcannon restored the simplify-venv branch August 3, 2019 00:08
@brettcannon brettcannon added the type-bug An unexpected behavior, bug, or error label Aug 3, 2019
@brettcannon
Copy link
Member Author

@vsajip any issues with this change?

Copy link
Member
@vsajip vsajip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@brettcannon brettcannon merged commit 48ede6b into python:master Aug 21, 2019
@brettcannon brettcannon deleted the simplify-venv branch August 21, 2019 22:58
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
…ROMPT__ for prompt customization (pythonGH-14941)

The activation scripts generated by venv were inconsistent in how they changed the shell's prompt. Some used `__VENV_PROMPT__` exclusively, some used `__VENV_PROMPT__` if it was set even though by default `__VENV_PROMPT__` is always set and the fallback matched the default, and one ignored `__VENV_PROMPT__` and used `__VENV_NAME__` instead (and even used a differing format to the default prompt). This change now has all activation scripts use `__VENV_PROMPT__` only and relies on the fact that venv sets that value by default.

The color of the customization is also now set in fish to the blue from the Python logo for as hex color support is built into that shell (much like PowerShell where the built-in green color is used).
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…ROMPT__ for prompt customization (pythonGH-14941)

The activation scripts generated by venv were inconsistent in how they changed the shell's prompt. Some used `__VENV_PROMPT__` exclusively, some used `__VENV_PROMPT__` if it was set even though by default `__VENV_PROMPT__` is always set and the fallback matched the default, and one ignored `__VENV_PROMPT__` and used `__VENV_NAME__` instead (and even used a differing format to the default prompt). This change now has all activation scripts use `__VENV_PROMPT__` only and relies on the fact that venv sets that value by default.

The color of the customization is also now set in fish to the blue from the Python logo for as hex color support is built into that shell (much like PowerShell where the built-in green color is used).
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
…ROMPT__ for prompt customization (pythonGH-14941)

The activation scripts generated by venv were inconsistent in how they changed the shell's prompt. Some used `__VENV_PROMPT__` exclusively, some used `__VENV_PROMPT__` if it was set even though by default `__VENV_PROMPT__` is always set and the fallback matched the default, and one ignored `__VENV_PROMPT__` and used `__VENV_NAME__` instead (and even used a differing format to the default prompt). This change now has all activation scripts use `__VENV_PROMPT__` only and relies on the fact that venv sets that value by default.

The color of the customization is also now set in fish to the blue from the Python logo for as hex color support is built into that shell (much like PowerShell where the built-in green color is used).
gentoo-bot pushed a commit to gentoo/cpython that referenced this pull request Apr 9, 2025
…ROMPT__ for prompt customization (pythonGH-14941)

The activation scripts generated by venv were inconsistent in how they changed the shell's prompt. Some used `__VENV_PROMPT__` exclusively, some used `__VENV_PROMPT__` if it was set even though by default `__VENV_PROMPT__` is always set and the fallback matched the default, and one ignored `__VENV_PROMPT__` and used `__VENV_NAME__` instead (and even used a differing format to the default prompt). This change now has all activation scripts use `__VENV_PROMPT__` only and relies on the fact that venv sets that value by default.

The color of the customization is also now set in fish to the blue from the Python logo for as hex color support is built into that shell (much like PowerShell where the built-in green color is used).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0