From owner-freebsd-questions Sat Aug 12 2: 1:11 2000 Delivered-To: freebsd-questions@freebsd.org Received: from oldyeller.comtest.com (cust1146.lava.net [207.26.201.122]) by hub.freebsd.org (Postfix) with ESMTP id 9B26337BC64 for ; Sat, 12 Aug 2000 02:00:59 -0700 (PDT) (envelope-from randal@hits.net) Received: from vaio (a24b165n56client22.hawaii.rr.com [24.165.56.22]) by oldyeller.comtest.com (8.9.2/8.9.2) with ESMTP id XAA59899; Fri, 11 Aug 2000 23:03:11 -1000 (HST) (envelope-from randal@hits.net) From: "Randal Masutani" To: Dru , freebsd-questions@FreeBSD.ORG Date: Fri, 11 Aug 2000 23:00:32 -1000 MIME-Version: 1.0 Content-type: text/enriched; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Can't get ansi color codes to work with sc0 console Reply-To: randal@hits.net Message-ID: <39948590.20415.64EB84@localhost> References: <399341E3.28197.49E6E6@localhost> In-reply-to: X-mailer: Pegasus Mail for Win32 (v3.12c) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 0100,0100,0100On 11 Aug 2000, at 8:21, Dru wrote: 7F00,0000,0000> > > On Thu, 10 Aug 2000, Randal Masutani wrote: > > > I am not able to get any ANSI color codes to > > work with the standard sc0 console since > > installing 4.1 release. > > > > All other releases I had no problem. Has anyone > > tried using something like: > > > > set prompt="^[[1;33;41m[`whoami`]^[[1;37;40m " > > > > All I get for the prompt is the exact same > > string between the quotes as shown above without > > any color. > > > > Is there something new in RELEASE 4.1 that > > handles color ANSI code differently? > > I had this same problem when I upgraded to 4.1 as I had saved my .cshrc > file. Do a search through the manpage for tcsh for "ls_colors" to see the > different syntax for tcsh. I've actually found it easier to use, just > different. > > Dru Courier NewI 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 ^[.Arial Courier NewSo, 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"' Randal To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message