aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2018-04-14 05:04:50 +0300
committerGitHub <noreply@github.com>2018-04-14 05:04:50 +0300
commit13b0e383a066c9c37d5cf71d4af521f9b73a173e (patch)
tree5ab3528e02d0e4062db52eda7d954c0744554fd7 /powerlevel9k.zsh-theme
parent0d8bfb68f44769add9d035eb07acc191485e197c (diff)
parente85fb6c93d6bc77d827133a3419d888fed5c8a4d (diff)
Merge pull request #795 from ryandav/rbenv-prompt-option-always-displays-#777
Rbenv prompt option always displays #777
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme11
1 files changed, 6 insertions, 5 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 1d34f344..0e09ef03 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1067,14 +1067,15 @@ prompt_ram() {
"$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$(printSizeHumanReadable "$ramfree" $base)" 'RAM_ICON'
}
+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.
- if [[ $rbenv_version_name == $rbenv_global ]]; then
+ if [[ $rbenv_version_name == $rbenv_global && "$POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW" = false ]]; then
return
fi
@@ -1425,7 +1426,7 @@ prompt_kubecontext() {
if [[ -z "$k8s_namespace" ]]; then
k8s_namespace="default"
fi
-
+
local k8s_final_text=""
if [[ "$k8s_context" == "k8s_namespace" ]]; then
@@ -1434,8 +1435,8 @@ prompt_kubecontext() {
else
k8s_final_text="$k8s_context/$k8s_namespace"
fi
-
-
+
+
"$1_prompt_segment" "$0" "$2" "magenta" "white" "$k8s_final_text" "KUBERNETES_ICON"
fi
}