I\'m using custom bash prompt to show git branch.
Everything is in /etc/bash/bashrc:
/etc/bash/bashrc
function formattedGitBranch { _branch=\"$(git b
Strings like \e[0;91m needs additional quoting, to prevent bash from calculating its length.
\e[0;91m
Enclose these strings from formattedGitBranch in \[ & \] as, \[\e[0;91m\]
formattedGitBranch
\[
\]
\[\e[0;91m\]
You have done it correctly in other places. Just missed it in formattedGitBranch.