|
|
|
|
|
|
|
function deactivate -d "Exit virtualenv and return to normal shell environment" |
|
|
|
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 "$_OLD_FISH_PROMPT_OVERRIDE" |
|
functions -e fish_prompt |
|
set -e _OLD_FISH_PROMPT_OVERRIDE |
|
functions -c _old_fish_prompt fish_prompt |
|
functions -e _old_fish_prompt |
|
end |
|
|
|
set -e VIRTUAL_ENV |
|
if test "$argv[1]" != "nondestructive" |
|
|
|
functions -e deactivate |
|
end |
|
end |
|
|
|
|
|
deactivate nondestructive |
|
|
|
set -gx VIRTUAL_ENV "/mnt/disks/flaxdisk/flax-bart-nb-nn/jax_env" |
|
|
|
set -gx _OLD_VIRTUAL_PATH $PATH |
|
set -gx PATH "$VIRTUAL_ENV/bin" $PATH |
|
|
|
|
|
if set -q PYTHONHOME |
|
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME |
|
set -e PYTHONHOME |
|
end |
|
|
|
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" |
|
|
|
|
|
|
|
functions -c fish_prompt _old_fish_prompt |
|
|
|
|
|
function fish_prompt |
|
|
|
set -l old_status $status |
|
|
|
|
|
if test -n "(jax_env) " |
|
printf "%s%s" "(jax_env) " (set_color normal) |
|
else |
|
|
|
set -l _checkbase (basename "$VIRTUAL_ENV") |
|
if test $_checkbase = "__" |
|
|
|
|
|
printf "%s[%s]%s " (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal) |
|
else |
|
printf "%s(%s)%s" (set_color -b blue white) (basename "$VIRTUAL_ENV") (set_color normal) |
|
end |
|
end |
|
|
|
|
|
echo "exit $old_status" | . |
|
_old_fish_prompt |
|
end |
|
|
|
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" |
|
end |
|
|