Bash custom prompt breaking wrapping of long command lines
Wrap each of your color variables in escaped square brackets:
\[${COL_USR}\]
or
COL_USR="\[${COL_Y}${COL_BRIGHT}\]"
That tells Bash that these are to be considered zero-width.
This is exactly as described in the question you linked to. If you do the following command, you'll see that your variable contain similar character sequences to the "handcrafted" ones. Using tput
only makes things portable to multiple $TERM
types, it doesn't affect the length of the code sequences. It is that length that is throwing things off.
echo ${COL_USR} | hexdump -c