Skip to content

Commit

Permalink
Added support for k8s context
Browse files Browse the repository at this point in the history
  • Loading branch information
Gigitsu committed Aug 21, 2020
1 parent 6bba672 commit 434e0e0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions agnoster.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ typeset -aHg AGNOSTER_PROMPT_SEGMENTS=(
prompt_status
prompt_context
prompt_virtualenv
prompt_kubecontext
prompt_dir
prompt_git
prompt_end
Expand Down Expand Up @@ -142,6 +143,20 @@ prompt_virtualenv() {
fi
}

prompt_kubecontext() {
local env='';

if [[ -n $KUBE_PS1_CONTEXT ]]; then
env="$KUBE_PS1_SYMBOL_DEFAULT$KUBE_PS1_SEPARATOR$KUBE_PS1_CONTEXT$KUBE_PS1_DIVIDER$KUBE_PS1_NAMESPACE"
fi

if [[ -n $env ]]; then
color=magenta
prompt_segment $color $PRIMARY_FG
print -Pn " $env "
fi
}

## Main prompt
prompt_agnoster_main() {
RETVAL=$?
Expand Down

0 comments on commit 434e0e0

Please sign in to comment.