From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13181 invoked from network); 12 Mar 2000 18:20:00 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Mar 2000 18:20:00 -0000 Received: (qmail 5946 invoked by alias); 12 Mar 2000 18:19:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10092 Received: (qmail 5937 invoked from network); 12 Mar 2000 18:19:52 -0000 Message-ID: <38CBDFBB.F2917D52@u.genie.co.uk> Date: Sun, 12 Mar 2000 18:19:39 +0000 From: Oliver Kiddle X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: Juhapekka Tolvanen CC: zsh-workers@sunsite.auc.dk Subject: Re: Good documentation about literal escape sequences in prompt? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Juhapekka Tolvanen wrote: > > Well, let's see: > > 1663 | p6 | juhtolv@heresy : /home/juhtolv > % . /usr/share/zsh/functions/colors > 1664 | p6 | juhtolv@heresy : /home/juhtolv > % PS1="%{$fg_bold[red]%}$PS1%{$reset_color%}" > [red]1665 | p6 | juhtolv@heresy : /home/juhtolv > % > > And whole prompt is now cyan-colored. I think that's a result of you using a slightly older version of Zsh than the latest. The colors function has changed so that $fg_bold is an associative array so for example $fg_bold[red] gives you the element indexed by 'red'. Have a look in the colors function for a variable definition for bold red and use that insead of $fg_bold[red] above or do it directly as follows: PS1="%{"$'\e[1;31m'"%}$PS1%{"$'\e[0m'"%}" > When I find some escape sequences from /usr/share/zsh/functions/colors, how > can I "convert" them so, that I can put them to my PS1 between %{...%} ? You should be able to take my line above as an example of this. > At least that question should be answered somewhere in docs. But it would be > better to list all escape sequences in such format, that can be added to > PS1 between %{...%}. The list of escape sequences are not a feature of zsh but of your terminal emulator. Try looking in the man pages for xterm. The colors function merely defines zsh variables for command ANSI standard escape sequences. Admittedly, the zsh docs could use a simple example of a coloured prompt though. Oliver Kiddle