Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Feb 2004 08:46:17 -0600
From:      Nathan Kinkade <nkinkade@ub.edu.bz>
To:        Didier WIROTH <didier.wiroth@mcesr.etat.lu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: customize set prompt question
Message-ID:  <20040202144617.GL3937@npkfbsd>
In-Reply-To: <0HSG002S0E0D8R@mail.etat.lu>
References:  <0HSG002S0E0D8R@mail.etat.lu>

next in thread | previous in thread | raw e-mail | index | archive | help

--+HaDSJYnsYzHewVa
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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

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

$ set prompt=3D"\[\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=3D"\[\e[1;31m\]@%m:%~# \[\e[m\]"

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

--+HaDSJYnsYzHewVa
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQFAHmK5O0ZIEthSfkkRApI/AJoDfvVJ8fhZsbzoh7sztVEkYc4KbACcCjeW
W+DksWlwvHM6hRQVrEWndLI=
=6ols
-----END PGP SIGNATURE-----

--+HaDSJYnsYzHewVa--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040202144617.GL3937>