I have reason to think I've got improper escaping in my bash prompt (I get weird random line wrapping in Terminal).
Can anyone point it out? It looks OK to me…
export PS1="\033[0;35m\u\033[00m on \033[0;36m\h\033[00m in \033[0;33m\w\033[00m \$ "
bashterminal
I have reason to think I've got improper escaping in my bash prompt (I get weird random line wrapping in Terminal).
Can anyone point it out? It looks OK to me…
export PS1="\033[0;35m\u\033[00m on \033[0;36m\h\033[00m in \033[0;33m\w\033[00m \$ "
Best Answer
Encase your colors in brackets
[]
so they count as non-printable characters.Unfortunately, this results in well-known line wrapping issues that is plagued by bash.
There is good news everyone, the light at the end of the tunnel is
tput
.Set all your variables first, then use it within the script.
You can find an example script in my github
dotfiles
repo