1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-12 08:50:08 +00:00

fix(ys): fix $VIRTUAL_ENV check if nounset is enabled (#9915)

This commit is contained in:
Kuri Schlarb 2022-01-27 20:48:42 +00:00 committed by GitHub
parent 59c40eee8e
commit 303ae79712
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,7 @@ local venv_info='$(virtenv_prompt)'
YS_THEME_VIRTUALENV_PROMPT_PREFIX=" %{$fg[green]%}"
YS_THEME_VIRTUALENV_PROMPT_SUFFIX=" %{$reset_color%}%"
virtenv_prompt() {
[[ -n ${VIRTUAL_ENV} ]] || return
[[ -n "${VIRTUAL_ENV:-}" ]] || return
echo "${YS_THEME_VIRTUALENV_PROMPT_PREFIX}${VIRTUAL_ENV:t}${YS_THEME_VIRTUALENV_PROMPT_SUFFIX}"
}