Skip to content

bpo-35328: Set VIRTUAL_ENV_PROMPT at venv activation #10745

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

Closed
wants to merge 1 commit into from

Conversation

blfpd
Copy link
Contributor

@blfpd blfpd commented Nov 27, 2018

From bpo-35328:

When creating a new virtual env with python3 -m venv .venv --prompt env, the prompt information is only used to set a temporary PS1.

This information is lost when using custom prompt, for example with ZSH.

I propose to set VIRTUAL_ENV_PROMPT=__VENV_PROMPT__ when activating the newly created venv, to be used by tools and other shells.

https://bugs.python.org/issue35328

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Our records indicate we have not received your CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

Copy link
Contributor

@csabella csabella left a comment

Choose a reason for hiding this comment

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

This change only adds the environment variable to the script for bash, but there are other activate files for powershell, windows, fish, and csh. If the variable is set in one environment, it would probably be best to set it for all environments.

@csabella
Copy link
Contributor

I'm going to close this pull request as there hasn't been any response to the code review. It can be reopened or a new pull request can be opened to replace it.

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.

4 participants