diff --git a/README.md b/README.md index 9c17c2c..c7d8b8e 100644 --- a/README.md +++ b/README.md @@ -500,6 +500,10 @@ It figures out the version being used by taking the output of the `rbenv version * If `rbenv` is not in $PATH, nothing will be shown. * If the current Ruby version is the same as the global Ruby version, nothing will be shown. +Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_RBENV_ALWAYS`|'false'|Always show rbenv version, even if global| + ##### rspec_stats See [Unit Test Ratios](#unit-test-ratios), below. diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 3c34f0b..dc2af02 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1047,11 +1047,15 @@ prompt_rbenv() { 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 + # Unless POWERLEVEL_RBENV_ALWAYS is set. + set_default POWERLEVEL9K_RBENV_ALWAYS false + if [[ $POWERLEVEL9K_RBENV_ALWAYS == true || $rbenv_version_name != $rbenv_global ]];then + "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON' + #elif [[ $rbenv_version_name != $rbenv_global ]]; then + # "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON' + #else + # return fi - - "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON' fi }