From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2364 invoked from network); 18 Aug 2006 13:09:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Aug 2006 13:09:12 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 99668 invoked from network); 18 Aug 2006 13:09:04 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Aug 2006 13:09:04 -0000 Received: (qmail 9979 invoked by alias); 18 Aug 2006 13:09:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22620 Received: (qmail 9969 invoked from network); 18 Aug 2006 13:09:00 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Aug 2006 13:09:00 -0000 Received: (qmail 99338 invoked from network); 18 Aug 2006 13:09:00 -0000 Received: from ms-2.rz.rwth-aachen.de (HELO ms-dienst.rz.rwth-aachen.de) (134.130.3.131) by a.mx.sunsite.dk with SMTP; 18 Aug 2006 13:08:59 -0000 Received: from r220-1 (r220-1.rz.RWTH-Aachen.DE [134.130.3.31]) by ms-dienst.rz.rwth-aachen.de (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0J47001A036Y48@ms-dienst.rz.rwth-aachen.de> for zsh-workers@sunsite.dk; Fri, 18 Aug 2006 15:08:58 +0200 (MEST) Received: from relay.rwth-aachen.de ([134.130.3.1]) by r220-1 (MailMonitor for SMTP v1.2.2 ) ; Fri, 18 Aug 2006 15:08:58 +0200 (MEST) Received: from fsst.voodoo.lan (i577BD6B5.versanet.de [87.123.214.181]) by relay.rwth-aachen.de (8.13.7/8.13.3/1) with ESMTP id k7ID8vFo017843 for ; Fri, 18 Aug 2006 15:08:57 +0200 (MEST) Received: from hawk by fsst.voodoo.lan with local (Exim 4.63) (envelope-from ) id 1GE45i-0008JF-1P for zsh-workers@sunsite.dk; Fri, 18 Aug 2006 15:08:50 +0200 Date: Fri, 18 Aug 2006 15:08:50 +0200 From: Frank Terbeck Subject: Re: prompt color pbg ,pfg,pbg_bold,pfg_bold in colors function? In-reply-to: <20060818102602.GA24702@finlandia.home.infodrom.org> To: Zsh-Workers Mail-followup-to: Zsh-Workers Message-id: <20060818130849.GD15840@fsst.voodoo.lan> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Content-disposition: inline Operating-System: Linux 2.6.16.16 i686 User-Agent: Mutt/1.5.13 (2006-08-11) References: <20060818102602.GA24702@finlandia.home.infodrom.org> Matthias Kopfermann : > The fg, fg_bold associative array and bg and bg_bold in the > colors function are quite useful. > > For _prompts_ i have to surround every variable with %{ %} which > does not , aehem, look too nice. > what do you think? would it be fine to have that with > wrapped around %{ %} , too so that not everybody has to put > these around the keys or roll a prompt_colors_array on his > own? > > I think, i would love to be able to just use > PS1=$pbg[red]%~ ... > and it just works out of the box in every zsh. > > Bad idea? Not at all, IMHO. I just think that the colors function would load quite a lot of redundant information, if these are added as well. Maybe these definitions could be added by a new function (e.g. prompt_colors). Of course you could add code like: [snip] for i in ${(k)fg} ; do pfg[$i]="%{$fg[$i]%}" ; done [snap] to your .zshrc, but I guess a loadable function would be easier for new users. As an addition: Today a user asked on IRC how to print out blinking text with the help of the autoloadable colors function. I told him that, this would do: [snip] blink="\e[${color[blink]}m" [snap] Maybe it would be helpful to add this to the colors function: [snip] blink_color="$lc${color[blink]}$rc" [snap] Regards, Frank