summaryrefslogtreecommitdiff
path: root/plugins/kubectx
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-01-04 11:38:53 +0100
committerMarc Cornellà <hello@mcornella.com>2022-01-04 11:53:41 +0100
commit31d63ea884e8ef56a40bed8771cdd8d3aec131f9 (patch)
tree39c691c0913cbf2e765e84d89cbb69b52e7a758e /plugins/kubectx
parenta7c46d0ebdbeb23d751a61be8f9b64935572f720 (diff)
downloadzsh-31d63ea884e8ef56a40bed8771cdd8d3aec131f9.tar.gz
zsh-31d63ea884e8ef56a40bed8771cdd8d3aec131f9.tar.bz2
zsh-31d63ea884e8ef56a40bed8771cdd8d3aec131f9.zip
fix(kubectx): allow prompt sequences in `kubectx_mapping` (#10562)
Fixes #10562
Diffstat (limited to 'plugins/kubectx')
-rw-r--r--plugins/kubectx/kubectx.plugin.zsh4
1 files 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/%/%%}}"
}