From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10534 invoked from network); 28 Feb 2002 15:34:56 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 28 Feb 2002 15:34:56 -0000 Received: (qmail 28008 invoked by alias); 28 Feb 2002 15:34:41 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4716 Received: (qmail 27996 invoked from network); 28 Feb 2002 15:34:41 -0000 Date: Thu, 28 Feb 2002 15:34:00 +0000 From: Ian Lynagh To: zsh-users@sunsite.dk Subject: Re: Length of %? in prompt Message-ID: <20020228153400.GA31674@stu163.keble.ox.ac.uk> Mail-Followup-To: zsh-users@sunsite.dk References: <20020226184213.GA16659@stu163.keble.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.25i Sender: Ian Lynagh On Tue, Feb 26, 2002 at 11:21:19AM -0800, Bart Schaefer wrote: > On Tue, 26 Feb 2002, Ian Lynagh wrote: > > > One more thing...as the first % escapes the second in > > "%%1v>-->%?---------%<< " it looks like there is no way to change this > > value on the fly without recreating the prompt - is this correct? > > If you "setopt promptsubst" you can use a variable for the width: I was trying to avoid this in favour of psvar, but I think it might be the best way to do this. I have just a couple more problems. Firstly I can't find a way to have ANSI escape sequences actually executed when they are passed through psvar - is this possible? And secondly with "%\$((\$COLUMNS-2))>%{%}k>" the %{%} appear in the prompt and both "%\$((\$COLUMNS-2))>${(%%):-%{$fg_bold[cyan]%\}}k>" and "%\$((\$COLUMNS-2))>\${(%%):-%{$fg_bold[cyan]%\}}k>" seem to be counting the length of the ANSI escape sequence in the length calculation - am I missing something? Thanks Ian, who's slowly getting there :-)