Date: Sun, 13 Aug 2000 10:19:38 +0100 From: Mark Ovens <marko@freebsd.org> To: Randal Masutani <randal@hits.net> Cc: Dru <genisis@istar.ca>, freebsd-questions@freebsd.org Subject: Re: Can't get ansi color codes to work with sc0 console Message-ID: <20000813101938.A254@parish> In-Reply-To: <39948590.20415.64EB84@localhost>; from randal@hits.net on Fri, Aug 11, 2000 at 11:00:32PM -1000 References: <399341E3.28197.49E6E6@localhost> <Pine.BSF.4.21.0008110817260.5420-100000@genisis.istar.ca> <39948590.20415.64EB84@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 11, 2000 at 11:00:32PM -1000, Randal Masutani wrote: > [snip] > I checked the man page for tcsh. However, the > LS_COLORS env variable is used only for 'ls' > listings. It does not apply to the 'prompt' > setting, which I am trying to use with color. > > I did find out from the tcsh man page that the > prompt variable has a different syntax than csh. > The ESCAPE character needs to be enclosed between > %{ and %}. This will treat the ESCAPE literaly. > Without these quotes the ESCAPE character is translated to the text > ^[. > > So, the above example should be now as: > set prompt="%{^[%}[1;33;41m[`whoami`]%{^[%}[1;37;40m " > > This works great, I now get color prompts. > > Actually I use a little more fancy prompt: > > set prompt="%{^[%}[1;33;41m[%n@%M:%~]%# %{^[%}[1;37;40m" > > alias cd 'cd \!*;set prompt="%{^[%}[1;33;41m[%n@%M:%~]%# > %{^[%}[1;37;40m"' > You no longer need to alias cd(1) with tcsh as you did with csh(1). The variable ``prompt'' is now dynamic, i.e. it gets evaluated every time a prompt is output. Remove your alias for cd(1) and you will see the same result. > Randal > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > > -- 4.4 - The number of the Beastie ________________________________________________________________ 51.44°N FreeBSD - The Power To Serve http://www.freebsd.org 2.057°W My Webpage http://ukug.uk.freebsd.org/~mark mailto:marko@freebsd.org http://www.radan.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000813101938.A254>