From 0d4e299fb3d6d06b8ccdd4b96f3deae638578fd7 Mon Sep 17 00:00:00 2001 From: Tom Bartlett Date: Tue, 10 Apr 2018 09:26:31 +0100 Subject: [PATCH] added cloud status to ps1 --- themes/agnoster.zsh-theme | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 07546fd34..5ff400736 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -84,6 +84,12 @@ prompt_context() { fi } +prompt_kubernetes() { + + local cluster=$(kubectl config current-context | grep --colour=never -o '^[^.]*\.[^.]*') + prompt_segment magenta black "☁️ ${cluster}☁️ " +} + # Git: branch/detached head, dirty status prompt_git() { (( $+commands[git] )) || return @@ -216,6 +222,7 @@ prompt_status() { build_prompt() { RETVAL=$? prompt_status + prompt_kubernetes prompt_virtualenv prompt_context prompt_dir