Skip to content
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

Fix broken prompt set up by activate.bat (#2225) #2226

Merged
merged 2 commits into from Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/2225.bugfix.rst
@@ -0,0 +1 @@
Fix broken prompt set up by activate.bat - by :user:`SiggyBar`.
8 changes: 4 additions & 4 deletions src/virtualenv/activation/batch/activate.bat
Expand Up @@ -13,11 +13,11 @@ if defined _OLD_VIRTUAL_PROMPT (
)
)
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) "
if "__VIRTUAL_PROMPT__" NEQ "" (
set "PROMPT=__VIRTUAL_PROMPT__%PROMPT%"
) else (
for %%d in ("%VIRTUAL_ENV%") do set "PROMPT=(%%~nxd) %PROMPT%"
)
set "PROMPT=%ENV_PROMPT%%PROMPT%"
)

REM Don't use () to avoid problems with them in %PATH%
Expand Down