Answers: <p>With the release of macOS Catalina (10.15) Apple has switched to Zsh as default shell (instead of Bash).
  Instead of setting <em>PS1</em> in Bash you can set <em>PROMPT</em> in Zsh:
  <code>PROMPT="${orange}%n"</code></p>
  
Answers: CC BY-SA 4.0
Answers: 2020-02-17T00:52:02.530Z
Answers: It is too bad this was hastened by fear of GPL3 versions of bash.  https://scriptingosx.com/2019/06/moving-to-zsh/
Answers: chicks
Answers: CC BY-SA 4.0
Answers: 2020-02-16T18:39:16.317Z
Answers: 2020-02-16T18:39:16.317Z
Answers: Paidhi
Body: <p>I can't get it to work on my Mac (catalina version 10.15.2).
  <code>\u</code> 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 <code>.bashrc</code> file when I test it by <code>source .bashrc</code>  .
  For example with the following in <code>.bashrc</code> in the user home directory.</p>
  
  <pre><code>orange=$(tput setaf 166);
  PS1="${orange}\u"
  export PS1;
  </code></pre>
  
  <p>Outputs my username in orange on ubuntu but on my Mac it just outputs <code>\u</code> in orange so for some reason <code>\u</code> isn't working on my Mac? Is there an alternative I could try?</p>
  
Tags: <bash><macos>
Title: Is \u the only way to output the user from .bashrc?
UserDisplayName: doug
ThreadText: # Is \u the only way to output the user from .bashrc?
  
  (Asked by: username_0 on 2020-02-16)
  
  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?
  
  **Tags:** bash, macos
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-02-16. Score: 3 | Accepted answer
  
  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"`
  
  > **Comments:**
  > **username_2**: It is too bad this was hastened by fear of GPL3 versions of bash.  https://scriptingosx.com/2019/06/moving-to-zsh/  
  
  ---
  
  