jonmosco / kube-ps1

Kubernetes prompt info for bash and zsh
Apache License 2.0
3.52k stars 351 forks source link

Fix reference to undefined ${OPEN,CLOSE}_ESC #160

Closed smitelli closed 2 years ago

smitelli commented 2 years ago

When kube-ps1 is invoked with a custom $KUBE_PS1_BG_COLOR, the resulting prompt is output without the correct escape bytes around the background color sequence. This causes shell history recall to wrap incorrectly and corrupt the line, as described in this BashFAQ.

This was caused by a reference to a nonexistent pair of variables, $OPEN_ESC and $CLOSE_ESC, in the _kube_ps1_color_bg function. This PR replaces these with $_KUBE_PS1_OPEN_ESC and _KUBE_PS1_CLOSE_ESC, which appears to be the original intention.

jonmosco commented 2 years ago

Great find! That one slipped through. Thank you!