Use parent directory name if the pwd is .venv

This commit is contained in:
Ceda EI 2021-02-14 16:31:18 +05:30
parent 4b9c2b6982
commit 61ade4610c
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ function wish_python_venv_set_colors() {
function wish_python_venv_main() {
if [[ -v VIRTUAL_ENV ]]; then
local venv=$(echo $VIRTUAL_ENV | sed 's|.*/||')
local venv=$(echo $VIRTUAL_ENV | sed ';s|/.venv$||;s|.*/||')
wish_append $WISH_PYTHON_VENV_BG $WISH_PYTHON_VENV_FG " $venv "
else
wish_append $WISH_PYTHON_VENV_BG $WISH_PYTHON_VENV_FG ""