forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeactivate.fish
More file actions
36 lines (33 loc) · 1.16 KB
/
deactivate.fish
File metadata and controls
36 lines (33 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Same as deactivate in "<venv>/bin/activate.fish"
function deactivate -d "Exit virtual environment and return to normal shell environment"
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$vscode_python_old_fish_prompt_OVERRIDE"
set -e vscode_python_old_fish_prompt_OVERRIDE
if functions -q vscode_python_old_fish_prompt
functions -e fish_prompt
functions -c vscode_python_old_fish_prompt fish_prompt
functions -e vscode_python_old_fish_prompt
end
end
set -e VIRTUAL_ENV
set -e VIRTUAL_ENV_PROMPT
if test "$argv[1]" != "nondestructive"
functions -e deactivate
end
end
# Initialize the variables required by deactivate function
set -gx _OLD_VIRTUAL_PATH $PATH
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
functions -c fish_prompt vscode_python_old_fish_prompt
end
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
end