I want to set my PS1 prompt to the output from a function, but when I try to include ansi color sequences, bash will think the line length is longer than it actually is and mess up when you type enough after it to go to a new line. Here's what the code looks like:
ps1() {
echo -ne "\033[01;34m$(dirs -0)\033[0m \$ "
}
PS1='$(ps1)'