1@echo off
2
3rem This file is UTF-8 encoded, so we need to update the current code page while executing it
4for /f "tokens=2 delims=:." %%a in ('"%SystemRoot%\System32\chcp.com"') do (
5    set _OLD_CODEPAGE=%%a
6)
7if defined _OLD_CODEPAGE (
8    "%SystemRoot%\System32\chcp.com" 65001 > nul
9)
10
11set VIRTUAL_ENV=__VENV_DIR__
12
13if not defined PROMPT set PROMPT=$P$G
14
15if defined _OLD_VIRTUAL_PROMPT set PROMPT=%_OLD_VIRTUAL_PROMPT%
16if defined _OLD_VIRTUAL_PYTHONHOME set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%
17
18set _OLD_VIRTUAL_PROMPT=%PROMPT%
19set PROMPT=__VENV_PROMPT__%PROMPT%
20
21if defined PYTHONHOME set _OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%
22set PYTHONHOME=
23
24if defined _OLD_VIRTUAL_PATH set PATH=%_OLD_VIRTUAL_PATH%
25if not defined _OLD_VIRTUAL_PATH set _OLD_VIRTUAL_PATH=%PATH%
26
27set PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%
28
29:END
30if defined _OLD_CODEPAGE (
31    "%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul
32    set _OLD_CODEPAGE=
33)
34