From 06ebe3b9af9af2e30f104b0956e255ca42ed5cab Mon Sep 17 00:00:00 2001 From: "Taylor \"Nekroze\" Lawson" Date: Thu, 16 Mar 2023 03:12:26 +1000 Subject: [PATCH] Hide k8s context or namespace when they are 'default' (#338) --- functions/fish_prompt.fish | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 898046e..21058ea 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -641,8 +641,10 @@ function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context' and [ -z $namespace -o "$namespace" = 'default' ] and return - set -l segment $k8s_glyph ' ' $context - [ -n "$namespace" ] + set -l segment $k8s_glyph ' ' + [ "$context" != 'default' ] + and set segment $segment $context + [ "$namespace" != 'default' ] and set segment $segment ':' $namespace __bobthefish_start_segment $color_k8s