I'd like to put my current git
branch into my multi-line ZSH prompt. However, this messes up the two lines - I'd like them to line up nicely.
┌─(simont@charmander:s000)─[master *]────────────────
───(~ )─┐
└─(127:15:44)── ──(Sat,May12)─┘
should be:
┌─(simont@charmander:s000)─[master *]─────────(~ )─┐
└─(127:15:44)── ──(Sat,May12)─┘
The git
branch is grabbed from an oh-my-zsh
function, git_prompt_info()
, which gives me the branch, dirty status, and a bunch of prompt-escapes to color things nicely.
How do I count the characters that will be visibly inserted into the ZSH prompt - not the prompt escape sequences?