From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14227 invoked from network); 4 Jul 2006 07:17:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Jul 2006 07:17:43 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 39316 invoked from network); 4 Jul 2006 07:17:34 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Jul 2006 07:17:34 -0000 Received: (qmail 27398 invoked by alias); 4 Jul 2006 07:17:26 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10472 Received: (qmail 27389 invoked from network); 4 Jul 2006 07:17:26 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Jul 2006 07:17:26 -0000 Received: (qmail 38242 invoked from network); 4 Jul 2006 07:17:26 -0000 Received: from vms042pub.verizon.net (206.46.252.42) by a.mx.sunsite.dk with SMTP; 4 Jul 2006 07:17:24 -0000 Received: from torch.brasslantern.com ([71.116.74.94]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J1V005VRAWSXHP1@vms042.mailsrvcs.net> for zsh-users@sunsite.dk; Tue, 04 Jul 2006 02:17:18 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k647HGLg031629 for ; Tue, 04 Jul 2006 00:17:16 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k647HG70031628 for zsh-users@sunsite.dk; Tue, 04 Jul 2006 00:17:16 -0700 Date: Tue, 04 Jul 2006 00:17:16 -0700 From: Bart Schaefer Subject: Remarks on Alex Polite's color names To: zsh-users@sunsite.dk Message-id: <060704001716.ZM31627@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii [Why are none of Alex's messages in the zsh-users archive, even though all the messages that reference them are there? The original one is in gmane, marked as expiring on July 17, but none of the followups.] The recent discussion about colored prompts with newlines included a number of parameter declarations such as fg_brown=$'%{\e[0;33m%}' fg_purple=$'%{\e[0;35m%}' I wanted to point out a few things about this, before someone looks at the "colors" function in the zsh distribution and says "Hey, why are brown and purple not defined in the $fg array?" Colors 33 and 35 are defined by the ANSI terminal spec as yellow and magenta, respectively, not brown and purple. In order to make "normal" and "bold" yellow distinct while still making them both readable, many terminal emulators now render "normal yellow" as a shade of tan rather than as a true yellow. For similar reasons (and as commented in the "colors" function source), "white" is frequently a very faint grey and "bold white" is truly white, and "black" is a very dark grey to appear different from 'bold black". This also applies to magenta -- against a (not quite) white background, the "normal" magenta looks purple, and "bold magenta" really is magenta (which Alex calls fg_light_purple). You can see all this better against a black (bold black) background; the color that looks tan/brown on white, looks much yellower on black. As for the exact escape sequence in $fg_brown above: the zero before the semicolon has the effect of resetting all color attributes before setting the foreground to yellow. This means that you can't combine Alex's $fg_brown with a background color. If the "0;" is omitted, the same foreground color is set, without first resetting the background or other attributes. In fact the form with the semicolon is a shortcut. You can set all the attributes sequentially instead, e.g. $'\e[0m\e[33m'. You can also use more than one semicolon, e.g.$'\e[5;40;33m' is black background with blinking yellow foreground. Look in the "colors" function file for other attribute values. You'll see there that "1" (as in "1;31" for Alex's fg_light_red) is meant to describe "bold", not "light" colors.