summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-06-07 00:15:51 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-06-07 00:40:37 +0300
commit55473c450a598c230ea388e169c62efe72add63b (patch)
tree09057d2f7d5743afcdcce1947305beba4ebe6617 /powerlevel9k.zsh-theme
parent7234d52ebd76b6b89e172ac5b19339f0a37ab596 (diff)
parent13b0e383a066c9c37d5cf71d4af521f9b73a173e (diff)
Merge branch 'master' into staging_065
Conflicts were: - README.md: Two commits targeted the brightness table. #781 from 14. April 2018 on master and #684 from 05. December 2017 on next. - powerlevel9k.zsh-theme: Two commits targeted the rbenv segment. Both achieve the same thing: To show the Ruby version number always. #795 on next from 14. April 2018 and #610 on master from 28. September 2017. I went with #795 here as this - although being newer - is the one on master, and that should be more stable.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme28
1 files changed, 18 insertions, 10 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 8f06866f..436398c0 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -895,7 +895,9 @@ prompt_dir() {
fi
;;
*)
- current_path="$(print -P "%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:$POWERLEVEL9K_SHORTEN_DELIMITER/:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c")"
+ if [[ $current_path != "~" ]]; then
+ current_path="$(print -P "%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:$POWERLEVEL9K_SHORTEN_DELIMITER/:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c")"
+ fi
;;
esac
fi
@@ -1229,18 +1231,19 @@ prompt_ram() {
"$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$(printSizeHumanReadable "$ramfree" $base)" 'RAM_ICON'
}
-################################################################
-# Segment to display rbenv information
-set_default POWERLEVEL9K_RBENV_ALWAYS false
+
+set_default POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW false
+# rbenv information
prompt_rbenv() {
- if which rbenv 2>/dev/null >&2; then
+ if command 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
- # unless `POWERLEVEL9K_RBENV_ALWAYS` is set.
- if [[ $POWERLEVEL9K_RBENV_ALWAYS == true || $rbenv_version_name != $rbenv_global ]];then
- "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON'
+ # unless `POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW` is set.
+ if [[ $rbenv_version_name == $rbenv_global && "$POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW" = false ]]; then
+ return
fi
fi
}
@@ -1337,8 +1340,13 @@ prompt_status() {
local ec
if [[ $POWERLEVEL9K_STATUS_SHOW_PIPESTATUS == true ]]; then
- ec_text=$(exit_code_or_status "${RETVALS[1]}")
- ec_sum=${RETVALS[1]}
+ if (( $#RETVALS > 1 )); then
+ ec_text=$(exit_code_or_status "${RETVALS[1]}")
+ ec_sum=${RETVALS[1]}
+ else
+ ec_text=$(exit_code_or_status "${RETVAL}")
+ ec_sum=${RETVAL}
+ fi
for ec in "${(@)RETVALS[2,-1]}"; do
ec_text="${ec_text}|$(exit_code_or_status "$ec")"