Created
July 11, 2021 16:18
-
-
Save vuldin/52758cc11b12a4f2f1c41f0f69913398 to your computer and use it in GitHub Desktop.
shorten context display within kube_ps1 prompt if it is too long
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Context | |
if [[ "${KUBE_PS1_CONTEXT_ENABLE}" == true ]]; then | |
KUBE_PS1_CONTEXT=$(echo $KUBE_PS1_CONTEXT | sed -E "s/(.{15}).*$/\1.../") | |
KUBE_PS1+="$(_kube_ps1_color_fg $KUBE_PS1_CTX_COLOR)${KUBE_PS1_CONTEXT}${KUBE_PS1_RESET_COLOR}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment