Skip to content

Update venv activate.bat to escape custom PROMPT variables on Windows #114885

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 1 commit into from
Feb 2, 2024

Conversation

GilgameshxZero
Copy link
Contributor

@GilgameshxZero GilgameshxZero commented Feb 1, 2024

Should the PROMPT environment variable contain special characters already (such as ^), this ensures the special characters are properly escaped when the prompt is prefixed in the venv activation script.

This also solves for special characters such as > or <, but > and < are more so a user error—they should instead be set as $G and $L in the PROMPT environment variable, in which case the activation script today will work fine. ^ does not have such an escape in the PROMPT environment variable and thus should be dealt with properly here.

More information about the PROMPT environment variable and escapes here: https://ss64.com/nt/prompt.html.

The change is small enough that I’ve decided to forego an issue number or NEWS update.

@ghost
Copy link

ghost commented Feb 1, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Feb 1, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@GilgameshxZero GilgameshxZero requested a review from vsajip February 2, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants