aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorRyan Davidson <daviryan@aol.com>2018-04-03 15:52:13 +0300
committerRyan Davidson <daviryan@aol.com>2018-04-03 15:52:13 +0300
commit9f7b0b7404a3d5307755d5e55ddc33e2e39090ba (patch)
tree9b54a67b9839fc86226ccac6134bc518e481e471 /powerlevel9k.zsh-theme
parentafb7387abec505fb6565d31481c5f5ed724c2f08 (diff)
#777 Add POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW variable to display prompt_rbenv if rbenv_version_name is the same as rbenv_global
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 14d7bd81..07902ba6 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1065,14 +1065,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
@@ -1418,7 +1419,7 @@ prompt_kubecontext() {
if [[ -z "$k8s_namespace" ]]; then
k8s_namespace="default"
fi
-
+
local k8s_final_text=""
if [[ "$k8s_context" == "k8s_namespace" ]]; then
@@ -1427,8 +1428,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
}