From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11470 invoked from network); 8 Sep 2005 16:05:48 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 8 Sep 2005 16:05:48 -0000 Received: (qmail 62689 invoked from network); 8 Sep 2005 16:05:41 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Sep 2005 16:05:41 -0000 Received: (qmail 25186 invoked by alias); 8 Sep 2005 16:05:29 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9402 Received: (qmail 25173 invoked from network); 8 Sep 2005 16:05:29 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 8 Sep 2005 16:05:29 -0000 Received: (qmail 61094 invoked from network); 8 Sep 2005 16:05:29 -0000 Received: from vms048pub.verizon.net (206.46.252.48) by a.mx.sunsite.dk with SMTP; 8 Sep 2005 16:05:22 -0000 Received: from candle.brasslantern.com ([71.116.79.190]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IMI00CBHA0S04N0@vms048.mailsrvcs.net> for zsh-users@sunsite.dk; Thu, 08 Sep 2005 11:05:17 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j88G5EYO015500; Thu, 08 Sep 2005 09:05:15 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j88G5Erc015499; Thu, 08 Sep 2005 09:05:14 -0700 Date: Thu, 08 Sep 2005 16:05:13 +0000 From: Bart Schaefer Subject: Re: Colored PS1 In-reply-to: <20050908.053110.07640431.Meino.Cramer@gmx.de> To: Meino Christian Cramer , zsh-users@sunsite.dk Message-id: <1050908160513.ZM15498@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050907.192106.74752061.Meino.Cramer@gmx.de> <1050908023921.ZM14908@candle.brasslantern.com> <20050908.053110.07640431.Meino.Cramer@gmx.de> Comments: In reply to Meino Christian Cramer "Re: Colored PS1" (Sep 8, 5:31am) 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 On Sep 8, 5:31am, Meino Christian Cramer wrote: } } > "escape sequence" in the context of terminals means "a series of ASCII } > characters, often beginning with the ESC (\033, \x1B) character." It } > is common for terminals and terminal emulators to recognize such a } > series of characters in the output and alter the terminal's behavior. } } ...oh I see...something like "commands"! :) Yes, except that the "commands" are embedded in the same stream as the ordinary non-command data. It's more like a very crude form of markup. In HTML, you'd write I am not bold but I am brave! and in "terminal markup" you'd write I am not bold but ^[[01;39mI am brave!^[[00m (where ^[ is the ESC character). In neither case do you see the markup when the text is displayed (hence, no cursor movement). } > The trouble is that "escape sequnce" in the context of a prompt means } > one of the pairs of characters that begins with a percent (%) sign. } > Again this is from the concept of a special combination of characters } > causing a change (an escape from) the usual interpretation of such } > characters. } > } ...do I understand this cxorrectly? In other words: } The trouble is, that a escape seuence can be misinterpreted as a } special sign of the prompt expanding itsself ? No, nothing like that. I'm only talking about humans misunderstanding the confusing terminology, not zsh misinterpreting the strings. Look at what I was just saying about markup ... prompts have "markup" too: I am not bold but %BI am brave!%b Prompt markup can't change colors, though, so sometimes you have to mix terminal markup and prompt markup. The prompt markup %{ and %} tell zsh that what's in between is some other kind of markup, so that it should not count it as something that occupies space on the display. } > In the worst case, you go look at the documentation for an ANSI standard } > terminal } > the definition whether any cursor movement is involved. } } URKS! Yeah, but that's why I said "in the worst case." } Setting PS1 directly without the addtional step using $prompt it does } not work. That makes no sense at all. Something is happening that you don't know how to tell us, and I don't know what to ask to learn what it is. However ... } I am happy haveing a colored prompt ... if you're happy, we don't need to pursue it any further right now. } ... only wihing that sometimes } zshall would be more understandable than totally complete. Wishing? Buy Oliver and Peter's book!