[Top] [All Lists]

~/.emacs_bash setting PS1

Subject: ~/.emacs_bash setting PS1
From: Samuel Karl Peterson
Date: Mon, 04 Feb 2008 17:41:09 -0800

I set my PS1 prompt so that it highlights the hostname portion of my
PS1 string.  I use different colors on different hosts so I have a
better visual cue as to which host I'm actually logged into (had some
mishaps in the past with running the wrong command on the wrong
machine).  It looks like this:

export PS1="[\u@\[\033[1;35m\]\h\[\033[0m\] \W]$ "

Unfortunately, in Emacs shell-mode, this doesn't show up correctly.  I
don't need for it to work in shell-mode.  The info manual says that
shell-mode reads the file ~/.emacs_SHELL depending on the shell used
(I use bash).  However, placing the above line into the ~/.emacs_bash
file doesn't seem to work.  Oddly enough, I can type 'exit' and then
I'll have a shell with the proper PS1 variable set.

Anyone have any advice for me?
Sam Peterson
skpeterson At nospam
"if programmers were paid to remove code instead of adding it,
software would be much better" -- unknown

<Prev in Thread] Current Thread [Next in Thread>