From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25004 invoked from network); 12 Mar 2000 00:06:06 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Mar 2000 00:06:06 -0000 Received: (qmail 21788 invoked by alias); 12 Mar 2000 00:05:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10078 Received: (qmail 21775 invoked from network); 12 Mar 2000 00:05:58 -0000 From: "Bart Schaefer" Message-Id: <1000312000522.ZM26743@candle.brasslantern.com> Date: Sun, 12 Mar 2000 00:05:22 +0000 In-Reply-To: Comments: In reply to Juhapekka Tolvanen "Good documentation about literal escape sequences in prompt?" (Mar 12, 1:41am) References: X-Mailer: Z-Mail (5.0.0 30July97) To: Juhapekka Tolvanen , zsh-workers@sunsite.auc.dk Subject: Re: Good documentation about literal escape sequences in prompt? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 12, 1:41am, Juhapekka Tolvanen wrote: } Subject: Good documentation about literal escape sequences in prompt? } } %{...%} } Include a string as a literal escape sequence. The } string within the braces should not change the cursor } position. Brace pairs can nest. } } Hey, come on! Do you really think that is enough? Why don't you provide some } good examples? I know you can do it better! It's an acknowledged problem that the docs need more examples. Care to provide any? } For example this does not work: } } PS1="%{\e[1;31m%}$PS1%{\e[1m%}" ^^^^^^^^ The doc says LITERAL escape sequence; the substring \e is not LITERALLY the character with ASCII value decimal-27. What other part of the doc gave you the idea that prompting would replace \e with something else? } Color-codes were found from /usr/share/zsh/functions/colors Well, then. What you want to do is (1) run that function `colors' to set up the $fg_bold array, etc., and then (2) set your prompt like this: PS1="%{$fg_bold[red]%}$PS1%{$reset_color%}" } I tried to understand other files in /usr/share/zsh/functions, like _prompt } and promptinit but even it was the real pain in the ass. It's also true that there's no doc for the prompts stuff yet. You type autoload -U promptinit promptinit And then you can get a little bit of help from `prompt -h'. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com