@@ -37,19 +37,26 @@ deactivate () {
3737deactivate nondestructive
3838
3939# 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
4852
4953_OLD_VIRTUAL_PATH="$PATH"
5054PATH="$VIRTUAL_ENV/"__VENV_BIN_NAME__":$PATH"
5155export PATH
5256
57+ VIRTUAL_ENV_PROMPT=__VENV_PROMPT__
58+ export VIRTUAL_ENV_PROMPT
59+
5360# unset PYTHONHOME if set
5461# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
5562# could use `if (set -u; : $PYTHONHOME) ;` in bash
6067
6168if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
6269 _OLD_VIRTUAL_PS1="${PS1:-}"
63- PS1=__VENV_PROMPT__"${PS1:-}"
70+ PS1="(" __VENV_PROMPT__") ${PS1:-}"
6471 export PS1
65- VIRTUAL_ENV_PROMPT=__VENV_PROMPT__
66- export VIRTUAL_ENV_PROMPT
6772fi
6873
6974# Call hash to forget past commands. Without forgetting
0 commit comments