Is \u the only way to output the user from .bashrc? I can't get it to work on my Mac (catalina version 10.15.2).
\u works on ubuntu when I test it but not on my Mac. 
I want to customize my mac terminal. Colors work fine on my Mac and it's reading the .bashrc file when I test it by source .bashrc  .
For example with the following in .bashrc in the user home directory.

orange=$(tput setaf 166);
PS1="${orange}\u"
export PS1;


Outputs my username in orange on ubuntu but on my Mac it just outputs \u in orange so for some reason \u isn't working on my Mac? Is there an alternative I could try?
With the release of macOS Catalina (10.15) Apple has switched to Zsh as default shell (instead of Bash).
Instead of setting PS1 in Bash you can set PROMPT in Zsh:
PROMPT="${orange}%n"