I'm running Zsh 5.2 on MacOS, running in Terminal.app with TERM set to xterm-256color
.
When styling the PROMPT, I found that in this Zsh version, a %b
cancels the effect of a previous %K
. Consider this example:
print -P '12%K{green}34%B56%b78%k90'
This prints only 3456 with green background, not 345678, as I would have expected.
If I replace the %B...%b by %U...%u or %S...%s, 345678 receives the green background. It seems that only %b is implicitly cancelling the effect of %K.
Can somebody explain, why this is so?
xterm-256color
. Using zsh 5.7.1-dev on Linux withrxvt-unicode
orxterm
I get the expected result. Can you narrow this down by trying another terminal emulator or a newer zsh version?