mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-06 07:20:40 +01:00
fix(kubectx): fix display of k8s contexts without double quotes (#12534)
BREAKING CHANGE: the `kubectx` plugin now properly displays contexts from the kubectx_mapping array, without using double quotes. Please refer to the plugin README to see how to use it properly. Closes #12534 Co-authored-by: Ken Kelly <ken@kenhkelly.us>
This commit is contained in:
@@ -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
|
||||
echo "${kubectx_mapping[\"$current_ctx\"]:-${current_ctx:gs/%/%%}}"
|
||||
# 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/%/%%}}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user