Something that should be noted when adding colors to your shell prompt function is adding the non printable characters that keep the terminal from buggin out, this caused me a massive headache until I figured it out. When putting it in the PS1 variable directly you will put [ to begin a color sequence and ] to end one, but printf will print a literal [ and ] so instead you will have to use `