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 f3ff367 commit 98cf251
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 @@ -129,6 +129,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 All @@ -138,6 +152,7 @@ prompt_agnoster_main() {
prompt_virtualenv
prompt_dir
prompt_git
prompt_kubecontext
prompt_end
}

Expand Down

0 comments on commit 98cf251

Please sign in to comment.