diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 4939cb354..d17c1ff73 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1276,7 +1276,7 @@ prompt_rbenv() { if [[ -n "$RBENV_VERSION" ]]; then "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$RBENV_VERSION" 'RUBY_ICON' elif [ $commands[rbenv] ]; then - local rbenv_version_name="$(rbenv version-name)" + local rbenv_version_name="$(rbenv version-name 2>/dev/null || echo "$(print_icon FAIL_ICON) $(rbenv local 2>/dev/null)")" local rbenv_global="$(rbenv global)" if [[ "${rbenv_version_name}" != "${rbenv_global}" || "${POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW}" == "true" ]]; then "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON'