1

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?

1 Answer 1

3

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"

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.