From 31d63ea884e8ef56a40bed8771cdd8d3aec131f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 4 Jan 2022 11:38:53 +0100 Subject: [PATCH] fix(kubectx): allow prompt sequences in `kubectx_mapping` (#10562) Fixes #10562 --- plugins/kubectx/kubectx.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/kubectx/kubectx.plugin.zsh b/plugins/kubectx/kubectx.plugin.zsh index af9a17ef1..1419f102f 100644 --- a/plugins/kubectx/kubectx.plugin.zsh +++ b/plugins/kubectx/kubectx.plugin.zsh @@ -1,4 +1,4 @@ -typeset -A kubectx_mapping +typeset -g -A kubectx_mapping function kubectx_prompt_info() { (( $+commands[kubectl] )) || return @@ -7,5 +7,5 @@ function kubectx_prompt_info() { # use value in associative array if it exists # otherwise fall back to the context name - echo "${${kubectx_mapping[$current_ctx]:-$current_ctx}:gs/%/%%}" + echo "${kubectx_mapping[$current_ctx]:-${current_ctx:gs/%/%%}}" }