Issue35328
Created on 2018-11-27 16:12 by batisteo, last changed 2022-04-11 14:59 by admin.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 10745 | closed | batisteo, 2018-11-27 16:25 | |
| PR 21587 | merged | ZackerySpytz, 2020-07-21 22:23 | |
| PR 22324 | open | mafredri, 2020-09-19 16:39 | |
| Messages (10) | |||
|---|---|---|---|
| msg330533 - (view) | Author: Baptiste Darthenay (batisteo) * | Date: 2018-11-27 16:12 | |
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. |
|||
| msg330542 - (view) | Author: Anthony Sottile (Anthony Sottile) * | Date: 2018-11-27 17:55 | |
The current prompt works fine for me on zsh -- what's the bug here? zsh $ virtualenv venv --prompt '(wat)' Using real prefix '/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7' New python executable in /private/tmp/venv/bin/python3.7 Also creating executable in /private/tmp/venv/bin/python Installing setuptools, pip, wheel...done. zsh $ . venv/bin/activate (wat)zsh $ |
|||
| msg330548 - (view) | Author: Baptiste Darthenay (batisteo) * | Date: 2018-11-27 18:49 | |
How the venv prompt name would be displayed in a project like Powerline? Or in VS Code? https://i.ibb.co/JHYrnk2/Screenshot-from-2018-11-27-19-41-47.png Or in my custom prompt? https://gist.github.com/batisteo/c5c9bd87a344cdbfb7a6401648c118a2#file-batisteo-zsh-theme-L194 |
|||
| msg333043 - (view) | Author: Karthikeyan Singaravelan (xtreak) * ![]() |
Date: 2019-01-05 05:42 | |
issue34439 seems like a similar proposal. I am adding @vinay.sajip. Since this seems like a new feature I have removed 3.7 from the version list. |
|||
| msg342860 - (view) | Author: Lysandros Nikolaou (lys.nikolaou) * ![]() |
Date: 2019-05-19 14:28 | |
Is anybody still working on this? |
|||
| msg343325 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2019-05-23 20:49 | |
@lys.nikolaou it looks like there was an initial PR, but it only updated things for Bash and not for all the other shells that we support for virtual environments. |
|||
| msg343327 - (view) | Author: Lysandros Nikolaou (lys.nikolaou) * ![]() |
Date: 2019-05-23 20:55 | |
@brettcannon, yeah I saw that, but there hasn't been any progress since November. I'm still interested in this though. What would the correct workflow be? Pushing commits to the same PR or opening a new one with a co-author? |
|||
| msg343328 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2019-05-23 21:00 | |
You can open a new PR with co-author or basing off of their fork if it's still around. |
|||
| msg374481 - (view) | Author: Vinay Sajip (vinay.sajip) * ![]() |
Date: 2020-07-28 08:42 | |
New changeset c82dda1e08c4b74ca24f88d6a549d93108c319cf by Zackery Spytz in branch 'master': bpo-35328: Set VIRTUAL_ENV_PROMPT at venv activation (GH-21587) https://github.com/python/cpython/commit/c82dda1e08c4b74ca24f88d6a549d93108c319cf |
|||
| msg377175 - (view) | Author: Mathias Fredriksson (mafredri) * | Date: 2020-09-19 15:55 | |
I believe GH-21587 does not fully address this issue because VIRTUAL_ENV_PROMPT is being conditionally set only if VIRTUAL_ENV_DISABLE_PROMPT is unset. Shell prompts must set VIRTUAL_ENV_DISABLE_PROMPT to non-empty to prevent venv from hijacking PS1. I'm one of the maintainers of the Pure prompt for zsh, and it would be great if VIRTUAL_ENV_PROMPT could always be set, just as VIRTUAL_ENV is too. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:08 | admin | set | github: 79509 |
| 2020-09-21 18:58:02 | brett.cannon | set | status: closed -> open resolution: fixed -> versions: + Python 3.10, - Python 3.9 |
| 2020-09-19 16:39:58 | mafredri | set | pull_requests: + pull_request21368 |
| 2020-09-19 15:55:21 | mafredri | set | nosy:
+ mafredri messages: + msg377175 |
| 2020-09-09 08:02:46 | vinay.sajip | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2020-07-28 08:42:04 | vinay.sajip | set | messages: + msg374481 |
| 2020-07-21 22:23:30 | ZackerySpytz | set | nosy:
+ ZackerySpytz pull_requests: + pull_request20727 |
| 2019-10-31 14:19:46 | vinay.sajip | set | versions: + Python 3.9, - Python 3.8 |
| 2019-05-23 21:00:26 | brett.cannon | set | messages: + msg343328 |
| 2019-05-23 20:55:25 | lys.nikolaou | set | messages: + msg343327 |
| 2019-05-23 20:49:07 | brett.cannon | set | nosy:
+ brett.cannon messages: + msg343325 |
| 2019-05-19 14:28:21 | lys.nikolaou | set | messages: + msg342860 |
| 2019-05-19 14:26:29 | lys.nikolaou | set | nosy:
+ lys.nikolaou |
| 2019-05-19 14:25:41 | xtreak | link | issue36966 superseder |
| 2019-01-05 05:42:56 | xtreak | set | versions:
- Python 3.7 nosy: + vinay.sajip, xtreak messages: + msg333043 components:
+ Library (Lib) |
| 2018-11-27 18:49:37 | batisteo | set | messages: + msg330548 |
| 2018-11-27 17:55:11 | Anthony Sottile | set | nosy:
+ Anthony Sottile messages: + msg330542 |
| 2018-11-27 16:25:05 | batisteo | set | keywords:
+ patch stage: patch review pull_requests: + pull_request9992 |
| 2018-11-27 16:12:29 | batisteo | create | |
