[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where is Bash Prompt Set??



On 11/02/10 17:16, John wrote:
On 11/02/10, Jon Dowland (jmtd@debian.org) wrote:

| ...
| I've never met a bash that displays anything other than '#'
| for '\$' in PS1. Can you give an example of one that does?

 From .bashrc:

# root; red
#export PS1='\[\033[0;31m\u@\w# \]'

Very useful thread, thank you all.

So, I've set my PS1 in /root/.bashrc as suggested.
From my user shell, I do 'su', and the prompt, and everything following is in red - good!
CTRL-D returns me to my user shell, and everything is still red - bad!

So, I figured that export PS1='\[\033[0;31m\u@\w$\033[0;30m \]' would return it back to black after the prompt - which it does, and I can live with that, but ideally, I'd like to save away the present colour, and restore it.
Can anyone suggest how to do that?

PS - where are these escape sequences documented, please?


--
Tony van der Hoff        | mailto:tony@vanderhoff.org
Buckinghamshire, England |


Reply to: