-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
parenthesis issue in activate.bat - caused by PR 2221 #2225
Labels
Comments
@SiggyBar can you look into this? |
Yes, #2221 did indeed break the prompt, sorry about that 😢 (I am not using cmd, so I did not notice.) The problem is caused by the expansion order inside the Maybe this is an acceptable fix? if not defined VIRTUAL_ENV_DISABLE_PROMPT (
set "ENV_PROMPT=__VIRTUAL_PROMPT__"
if NOT DEFINED ENV_PROMPT (
for %%d in ("%VIRTUAL_ENV%") do set "ENV_PROMPT=(%%~nxd) "
)
set "PROMPT=%ENV_PROMPT%%PROMPT%"
) -> if not defined VIRTUAL_ENV_DISABLE_PROMPT (
if "__VIRTUAL_PROMPT__" NEQ "" (
set "PROMPT=__VIRTUAL_PROMPT__%PROMPT%"
) else (
for %%d in ("%VIRTUAL_ENV%") do set "PROMPT=(%%~nxd) %PROMPT%"
)
) |
Please put in a PR if solves the issue 👍 |
SigmundVik
added a commit
to SigmundVik/virtualenv
that referenced
this issue
Oct 27, 2021
Removing the stray closing parenthesis in activate.bat in commit 35ec441 broke the virtual environment prompt prefix in Windows cmd. The reason for this was that the ill-formed closing parenthesis somehow affected the variable expansion order. This commit fixes the issue by not using a local ENV_PROMPT variable to update the prompt. (So an additional benefit of this change is one less variable set in the environment.) Fixes: pypa#2225
5 tasks
gaborbernat
pushed a commit
that referenced
this issue
Oct 28, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The fix in #2221 for the extra parenthesis in "activate.bat" seems to have broken the prompt change when used interactively. Now, the prompt does not change when you invoke "activate.bat". I agree there was an extra parenthesis before this fix, but apparently that caused the SET PROMPT to have the correct updated value of ENV_PROMPT when it was evaluated b/c that put it outside the other block.
The text was updated successfully, but these errors were encountered: