diff options
| author | spetafree <6402127+spetafree@users.noreply.github.com> | 2020-03-03 10:55:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-03 08:55:47 +0000 |
| commit | dd37c7d2af8a21026f4d4b7f43142e4e1e0faf86 (patch) | |
| tree | d772e034adf36131ed63d5ecdd6708ea960eaaaf /src/virtualenv/activation/batch | |
| parent | 7649968fcc673336e510a18d4d1d20feef48fe4b (diff) | |
| download | virtualenv-dd37c7d2af8a21026f4d4b7f43142e4e1e0faf86.tar.gz | |
Default prompt of environment name in batch shell (#1679)
* Default prompt of environment name in batch shell
* Handle batch prompt in activate.bat
* change test folder name to aviod bat escapes
* run activation tests with and without prompt
* test for correct prompt in batch (only, for now)
* Try to normalize path in batch tests
* update description
* Update 1679.bugfix.rst
* Update conftest.py
* Update conftest.py
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
* better names
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
Diffstat (limited to 'src/virtualenv/activation/batch')
| -rw-r--r-- | src/virtualenv/activation/batch/activate.bat | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/virtualenv/activation/batch/activate.bat b/src/virtualenv/activation/batch/activate.bat index 96e835b..c0949ba 100644 --- a/src/virtualenv/activation/batch/activate.bat +++ b/src/virtualenv/activation/batch/activate.bat @@ -13,7 +13,12 @@ if defined _OLD_VIRTUAL_PROMPT ( ) ) if not defined VIRTUAL_ENV_DISABLE_PROMPT ( - set "PROMPT=__VIRTUAL_PROMPT__%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%" ) REM Don't use () to avoid problems with them in %PATH% |
