summaryrefslogtreecommitdiff
path: root/plugins/kubectx/kubectx.plugin.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2026-01-04 22:47:54 -0800
committerTuowen Zhao <ztuowen@gmail.com>2026-01-04 22:47:54 -0800
commit2aa4cb7a52b28722816ecfd55f3b06293332c55c (patch)
treef02a9f3d59d109c70caf932a24e43368994e0e8c /plugins/kubectx/kubectx.plugin.zsh
parent7e951c254e779ff0620537cf43ca69dd878387b4 (diff)
parentd23d3ea69fdb839088e6e5589557cce77b34aaf8 (diff)
downloadzsh-2aa4cb7a52b28722816ecfd55f3b06293332c55c.tar.gz
zsh-2aa4cb7a52b28722816ecfd55f3b06293332c55c.tar.bz2
zsh-2aa4cb7a52b28722816ecfd55f3b06293332c55c.zip
Merge remote-tracking branch 'github/master'HEADmaster
Diffstat (limited to 'plugins/kubectx/kubectx.plugin.zsh')
-rw-r--r--plugins/kubectx/kubectx.plugin.zsh6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/kubectx/kubectx.plugin.zsh b/plugins/kubectx/kubectx.plugin.zsh
index 6096feeae..f1ca990ad 100644
--- a/plugins/kubectx/kubectx.plugin.zsh
+++ b/plugins/kubectx/kubectx.plugin.zsh
@@ -7,7 +7,9 @@ function kubectx_prompt_info() {
[[ -n "$current_ctx" ]] || return
- # use value in associative array if it exists
- # otherwise fall back to the context name
+ # Use value in associative array if it exists, otherwise fall back to the context name
+ #
+ # Note: we need to escape the % character in the prompt string when coming directly from
+ # the context name, as it could contain a % character.
echo "${kubectx_mapping[$current_ctx]:-${current_ctx:gs/%/%%}}"
}