customize set prompt question

Nathan Kinkade nkinkade at ub.edu.bz
Mon Feb 2 06:47:21 PST 2004


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;31m\]@%m:%~# \[\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;31m\]@%m:%~# \[\e[m\]"

Nathan
-- 
gpg --keyserver pgp.mit.edu --recv-keys D8527E49
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040202/bf8da4db/attachment-0001.bin


More information about the freebsd-questions mailing list