Skip to content

Commit

Permalink
Fix broken prompt set up by activate.bat (#2225) (#2226)
Browse files Browse the repository at this point in the history
  • Loading branch information
SigmundVik authored Oct 28, 2021
1 parent 653d4eb commit 31f3913
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/changelog/2225.bugfix.rst
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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

0 comments on commit 31f3913

Please sign in to comment.