From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17837 invoked from network); 7 Sep 2005 03:23:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Sep 2005 03:23:53 -0000 Received: (qmail 54777 invoked from network); 7 Sep 2005 03:23:47 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Sep 2005 03:23:47 -0000 Received: (qmail 14226 invoked by alias); 7 Sep 2005 03:23:39 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9396 Received: (qmail 14216 invoked from network); 7 Sep 2005 03:23:38 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Sep 2005 03:23:38 -0000 Received: (qmail 53775 invoked from network); 7 Sep 2005 03:23:38 -0000 Received: from p5485226b.dip0.t-ipconnect.de (HELO solfire) (84.133.34.107) by a.mx.sunsite.dk with SMTP; 7 Sep 2005 03:23:34 -0000 Received: from localhost ([127.0.0.1]) by solfire with esmtp (Exim 4.42) id 1ECqZC-0000lN-RF for zsh-users@sunsite.dk; Wed, 07 Sep 2005 05:25:43 +0200 Date: Wed, 07 Sep 2005 05:25:42 +0200 (CEST) Message-Id: <20050907.052542.74749449.Meino.Cramer@gmx.de> To: zsh-users@sunsite.dk From: Meino Christian Cramer X-Mailer: Mew version 4.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Rcpt-To: zsh-users@sunsite.dk X-SA-Exim-Mail-From: Meino.Cramer@gmx.de Subject: Colored PS1 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SA-Exim-Version: 4.1+cvs (built Sat, 28 Aug 2004 13:10:40 +0200) X-SA-Exim-Scanned: Yes (on solfire) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 Hi, from the german version of the zsh-lovers page I got the following hint to colorise the prompt of the shell: autoload -U colors && colors echo "$fg_bold[red]zsh $fg_no_bold[white]is $bg[blue]$fg_bold[green]nice" which prints a colored string. So far so nice. Now I thought my previous PS1-string export PS1="%B%(?..[%?] )%b%n@%U%m%u:%1~>" would be nicer if I would change it to: export PS1="%B%(?..[%?] )$fg_bold[red]%b$fg_no_bold[black]%n@%U%m%u:%1~>" but this does not work for me. The prompt remains the same but expansion/expanding on the commandline gets a hickup. My TERM is set to "xterm" and normally colored output is no problem. What is wrong in my assumption, that first the $fg_bold[red] and $fg_no_bold[black] get expanded to their "real" escape sequences and then and thing like %b get replaced by their current value and then the string is sent to the terminal which finally colors the output accordingly? If I do a echo $PS1" I get a correctly colored output (the special expanding of for example %b is missing then, which is ok). Hmmm....? Thank you very much for any help in advance ! Have a nice week! Meino