@@ -37,19 +37,26 @@ deactivate () {
37
37
deactivate nondestructive
38
38
39
39
# on Windows, a path can contain colons and backslashes and has to be converted:
40
- if [ "${OSTYPE:-}" = "cygwin" ] || [ "${OSTYPE:-}" = "msys" ] ; then
41
- # transform D:\path\to\venv to /d/path/to/venv on MSYS
42
- # and to /cygdrive/d/path/to/venv on Cygwin
43
- export VIRTUAL_ENV=$(cygpath __VENV_DIR__)
44
- else
45
- # use the path as-is
46
- export VIRTUAL_ENV=__VENV_DIR__
47
- fi
40
+ case "$(uname)" in
41
+ CYGWIN*|MSYS*|MINGW*)
42
+ # transform D:\path\to\venv to /d/path/to/venv on MSYS and MINGW
43
+ # and to /cygdrive/d/path/to/venv on Cygwin
44
+ VIRTUAL_ENV=$(cygpath __VENV_DIR__)
45
+ export VIRTUAL_ENV
46
+ ;;
47
+ *)
48
+ # use the path as-is
49
+ export VIRTUAL_ENV=__VENV_DIR__
50
+ ;;
51
+ esac
48
52
49
53
_OLD_VIRTUAL_PATH="$PATH"
50
54
PATH="$VIRTUAL_ENV/"__VENV_BIN_NAME__":$PATH"
51
55
export PATH
52
56
57
+ VIRTUAL_ENV_PROMPT=__VENV_PROMPT__
58
+ export VIRTUAL_ENV_PROMPT
59
+
53
60
# unset PYTHONHOME if set
54
61
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
55
62
# could use `if (set -u; : $PYTHONHOME) ;` in bash
60
67
61
68
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
62
69
_OLD_VIRTUAL_PS1="${PS1:-}"
63
- PS1=__VENV_PROMPT__"${PS1:-}"
70
+ PS1="(" __VENV_PROMPT__") ${PS1:-}"
64
71
export PS1
65
- VIRTUAL_ENV_PROMPT=__VENV_PROMPT__
66
- export VIRTUAL_ENV_PROMPT
67
72
fi
68
73
69
74
# Call hash to forget past commands. Without forgetting
0 commit comments