diff options
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 59733acd..590dc300 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -605,8 +605,16 @@ prompt_ram() { # rbenv information prompt_rbenv() { - if [[ -n "$RBENV_VERSION" ]]; then - "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$RBENV_VERSION" 'RUBY_ICON' + if which rbenv 2>/dev/null >&2; then + local rbenv_version_name="$(rbenv version-name)" + local rbenv_global="$(rbenv global)" + + # Don't show anything if the current Ruby is the same as the global Ruby. + if [[ $rbenv_version_name == $rbenv_global ]]; then + return + fi + + "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON' fi } |