1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-24 13:10:07 +00:00

Fix cleanup of generic virtualenv names

This commit is contained in:
Alex Jurkiewicz 2023-10-12 14:10:08 +08:00
parent 86088963ce
commit fe9b9f9c3e

View file

@ -4287,7 +4287,7 @@ _virtualenv_load_name_VIRTUAL_ENV() {
if [[ $VIRTUAL_ENV_PROMPT == '('?*') ' && $VIRTUAL_ENV_PROMPT != "($n) " ]]; then if [[ $VIRTUAL_ENV_PROMPT == '('?*') ' && $VIRTUAL_ENV_PROMPT != "($n) " ]]; then
_virtualenv_name=$VIRTUAL_ENV_PROMPT[2,-3] _virtualenv_name=$VIRTUAL_ENV_PROMPT[2,-3]
# Use parent directory name if virtualenv name is generic (eg .venv) # Use parent directory name if virtualenv name is generic (eg .venv)
elif [[ $v == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]]; then elif [[ ${VIRTUAL_ENV:t} == $~_POWERLEVEL9K_VIRTUALENV_GENERIC_NAMES ]]; then
_virtualenv_name=${VIRTUAL_ENV:h:t} _virtualenv_name=${VIRTUAL_ENV:h:t}
# Otherwise use the virtualenv name as-is # Otherwise use the virtualenv name as-is
else else