I'm trying to add colors and customize the shell prompt on OS X Lion so I edited .bashrc and I can only see the differences for the root account. So, after I edit the .bashrc with:

PS1="[\u][\w] :"

and run the terminal I get

Phil:~ phil$ sudo -s
[root][~] :

but I only see the difference in the root account. How can I fix this?

I want to display:

[Phil][~] : sudo -s
[root][~] :
link|improve this question
You could try ZSH (or a different shell). I know it has all sorts of colors and customizations. If you just want to edit bash, I would recommend changing the question to "add olors and customize bash on OS X Lion). – kalaracey Jun 27 '11 at 15:56
feedback

1 Answer

up vote 0 down vote accepted

You need to edit the file .bash_profile in your home directory, i.e. /Users/username/.bash_profile.

link|improve this answer
hey, it works :) thanks. – philberndt Jun 26 '11 at 20:59
Note: ~/.bash_profile is run by login shells. ~/.bashrc is run by non-login shells. To ensure customizations work with both login and non-login shells, put common customizations in ~/.bashrc and have ~/.bash_profile run that with: if [ -f $HOME/.bashrc ]; then . $HOME/.bashrc fi – Chris Page Aug 21 '11 at 8:16
Terminal creates login shells by default. If you run bash from a login shell, that creates a non-login shell. Sub-shells are non-login shells by default. – Chris Page Aug 21 '11 at 8:18
feedback

Your Answer

 
or
required, but never shown

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