diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2019-01-24 00:25:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-24 00:25:05 +0300 |
commit | e028513bb9a2284506563fa5d15e1a7d8e25e3fe (patch) | |
tree | f99677328926af35424769be0680dfae980bf3c1 | |
parent | 2f4b15041fe31d85dc9ef705b818c3a0e6985da3 (diff) | |
parent | ee7416962d80dfaaed7efd57511d5aa568480d21 (diff) |
Merge pull request #1128 from ymage/fix_virtualenv_prompt
[Bugfix] virtualenv prompt displaying
-rwxr-xr-x | powerlevel9k.zsh-theme | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 79237385..60c16b5a 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1648,9 +1648,11 @@ prompt_vi_mode() { # https://virtualenv.pypa.io/en/latest/ prompt_virtualenv() { local virtualenv_path="$VIRTUAL_ENV" - if [[ -n "$virtualenv_path" && -z "$VIRTUAL_ENV_DISABLE_PROMPT" ]]; then - "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$(basename "$virtualenv_path")" 'PYTHON_ICON' - fi + + # Early exit; $virtualenv_path must always be set. + [[ -z "$virtualenv_path" ]] && return + + "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$(basename "$virtualenv_path")" 'PYTHON_ICON' } ################################################################ |