customize set prompt question

2004-02-02 Thread Didier WIROTH
Hi,

I would like to colorize this prompt:
set prompt=@%m:%~# 

How do I have to modify the prompt so that the entire prompt is of red
color. 
Only the prompt should be red, not what is typed or the results of any
output.

many thanks

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: customize set prompt question

2004-02-02 Thread Nathan Kinkade
On Mon, Feb 02, 2004 at 11:48:13AM +0100, Didier WIROTH wrote:
 Hi,
 
 I would like to colorize this prompt:
 set prompt=@%m:%~# 
 
 How do I have to modify the prompt so that the entire prompt is of red
 color. 
 Only the prompt should be red, not what is typed or the results of any
 output.
 
 many thanks

Does csh understand ansi escape sequences?  If so you could try this:

$ set prompt=\[\e[1;[EMAIL PROTECTED]:%~# \[\e[m\]

I don't know if this will work in csh, but it definitely works in bash.
For bash it would be:

$ export PS1=\[\e[1;[EMAIL PROTECTED]:%~# \[\e[m\]

Nathan
-- 
gpg --keyserver pgp.mit.edu --recv-keys D8527E49


pgp0.pgp
Description: PGP signature


Re: customize set prompt question

2004-02-02 Thread Chris Riley
FWIW this is what I use in my .bashrc. The contol codes are for an ANSI 
terminal, the shell doesn't care what to use. The \[ and \] are bash 
specific, you'll want to remove them for csh.

BLACK=\[\e[0;30m\]
BLUE=\[\e[0;34m\]
GREEN=\[\e[0;32m\]
CYAN=\[\e[0;36m\]
RED=\[\e[0;31m\]
PURPLE=\[\e[0;35m\]
BROWN=\[\e[0;33m\]
LIGHT_GRAY=\[\e[0;37m\]
DARK_GRAY=\[\e[1;30m\]
LIGHT_BLUE=\[\e[1;34m\]
LIGHT_GREEN=\[\e[1;32m\]
LIGHT_CYAN=\[\e[1;36m\]
LIGHT_RED=\[\e[1;31m\]
LIGHT_PURPLE=\[\e[1;35m\]
YELLOW=\[\e[1;33m\]
WHITE=\[\e[1;37m\]
NO_COLOR=\[\e[0m\]
who am i | grep '^root'  /dev/null
if [ $? = 0 ] ;then
COLOR=$RED
else
COLOR=$LIGHT_GREEN
fi
export PS1=$COLOR\u$NO_COLOR:$YELLOW\w$NO_COLOR\$ 
Nathan Kinkade wrote:
On Mon, Feb 02, 2004 at 11:48:13AM +0100, Didier WIROTH wrote:

Hi,

I would like to colorize this prompt:
set prompt=@%m:%~# 
How do I have to modify the prompt so that the entire prompt is of red
color. 
Only the prompt should be red, not what is typed or the results of any
output.

many thanks


Does csh understand ansi escape sequences?  If so you could try this:

$ set prompt=\[\e[1;[EMAIL PROTECTED]:%~# \[\e[m\]

I don't know if this will work in csh, but it definitely works in bash.
For bash it would be:
$ export PS1=\[\e[1;[EMAIL PROTECTED]:%~# \[\e[m\]

Nathan
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]