diff options
author | SiggyBar <sigmund_vik@yahoo.com> | 2021-10-28 16:13:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 15:13:42 +0100 |
commit | 31f39137544bfea32c475f4a99473900a2995144 (patch) | |
tree | 386955ddbc81054ca78fe902ef8df099c8dccac6 | |
parent | 653d4ebcaae635183e95fba40a8bf3592ec3647e (diff) | |
download | virtualenv-31f39137544bfea32c475f4a99473900a2995144.tar.gz |
Fix broken prompt set up by activate.bat (#2225) (#2226)
-rw-r--r-- | docs/changelog/2225.bugfix.rst | 1 | ||||
-rw-r--r-- | src/virtualenv/activation/batch/activate.bat | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/docs/changelog/2225.bugfix.rst b/docs/changelog/2225.bugfix.rst new file mode 100644 index 0000000..f7cab3e --- /dev/null +++ b/docs/changelog/2225.bugfix.rst @@ -0,0 +1 @@ +Fix broken prompt set up by activate.bat - by :user:`SiggyBar`. diff --git a/src/virtualenv/activation/batch/activate.bat b/src/virtualenv/activation/batch/activate.bat index 2ce9e5a..184e4f9 100644 --- a/src/virtualenv/activation/batch/activate.bat +++ b/src/virtualenv/activation/batch/activate.bat @@ -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% |