From a9d99c9cab69bd52edd3584ea426d8dacd6e8929 Mon Sep 17 00:00:00 2001 From: venyii Date: Fri, 5 Jul 2019 01:10:26 +0200 Subject: Add ability to provide a cluster function in kubecontext segment This makes it possible to customize the displayed cluster name, e.g. `gke_project-name-1337_europe-west1-c_production` -> `production` --- internal/p10k.zsh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'internal') diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 825fd772..a1cbe3e0 100755 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -2126,6 +2126,9 @@ prompt_kubecontext() { fi done fi + if [[ -n $POWERLEVEL9K_KUBECONTEXT_CONTEXT_FUNCTION ]]; then + ctx=$($POWERLEVEL9K_KUBECONTEXT_CONTEXT_FUNCTION $ctx) + fi _p9k_cache_set "$ctx" "$suf" fi -- cgit v1.2.3