Created attachment 169460 [details]
The ports libedit incorrectly removes ESC characters from the prompt, thus corrupting output when using a colored prompt. Both libreadline and the base libedit pass ESC unaltered.
Can you test against the recently released 20160618 version of libedit? It was briefly in the ports tree but had some (unknown to me) trouble with mysql, so you'll have to manually update your libedit port to test it (see libedit commits on June 18 & 19).
Is this still a problem, I could not reproduce it.