2020-06-28 21:44:40 +03:00
|
|
|
function _tide_item_virtual_env
|
|
|
|
if set -q VIRTUAL_ENV
|
2020-06-29 05:27:32 +03:00
|
|
|
set_color $tide_virtual_env_color
|
|
|
|
|
|
|
|
printf '%s' {$tide_virtual_env_icon}' '
|
2020-07-10 03:34:15 +03:00
|
|
|
|
|
|
|
set -l splitVirtualEnv (string split '/' "$VIRTUAL_ENV")
|
|
|
|
|
2020-06-28 21:44:40 +03:00
|
|
|
if test "$tide_virtual_env_display" = 'projectName'
|
2020-07-10 03:34:15 +03:00
|
|
|
printf '%s' $splitVirtualEnv[-2]
|
2020-06-28 21:44:40 +03:00
|
|
|
else if test "$tide_virtual_env_display" = 'venvName'
|
2020-07-10 03:34:15 +03:00
|
|
|
printf '%s' $splitVirtualEnv[-1]
|
2020-06-28 21:44:40 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|