From a2ad38aa051aaed25ae3bd6129986e7f27d42d7b Mon Sep 17 00:00:00 2001 From: Thibault Lacroux Date: Mon, 4 May 2020 15:48:01 +0200 Subject: [PATCH] Do not display Kubernetes context and namespace if it's the defaults ones --- fish_prompt.fish | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fish_prompt.fish b/fish_prompt.fish index 6ce9052..4c47f7f 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -625,6 +625,10 @@ function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context' [ "$theme_display_k8s_namespace" = 'yes' ] and set -l namespace (__bobthefish_k8s_namespace) + [ -z $context -o "$context" = 'default' ] + and [ -z $namespace -o "$namespace" = 'default' ] + and return + set -l segment $k8s_glyph " " $context [ -n "$namespace" ] and set segment $segment ":" $namespace