From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12820 invoked from network); 26 Feb 2002 18:08:38 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Feb 2002 18:08:38 -0000 Received: (qmail 2489 invoked by alias); 26 Feb 2002 18:08:22 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4696 Received: (qmail 2476 invoked from network); 26 Feb 2002 18:08:22 -0000 Date: Tue, 26 Feb 2002 18:08:07 +0000 From: Ian Lynagh To: zsh-users@sunsite.dk Subject: Re: Length of %? in prompt Message-ID: <20020226180806.GA16191@stu163.keble.ox.ac.uk> Mail-Followup-To: zsh-users@sunsite.dk References: <20020226160503.GA15163@stu163.keble.ox.ac.uk> <1020226171045.ZM9835@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1020226171045.ZM9835@candle.brasslantern.com> User-Agent: Mutt/1.3.25i Sender: Ian Lynagh On Tue, Feb 26, 2002 at 05:10:45PM +0000, Bart Schaefer wrote: > On Feb 26, 4:05pm, Ian Lynagh wrote: > } > } If the length of %? will alter the number of dashes following it in my > } prompt am I right in thinking that my only course of action is to > } enumerate the (rather large!) set of possible cases with > } "%(n?,---...,)"? If so I guess I will have to redesign :-( > > No, you don't need to do that. You can use the truncation sequences %>> > and/or %<<. Let's assume that you want the value of %? plus the hyphens > to take up a total of 10 characters; you'd use: > > %10>-->%?--------%<< Oh, of course! In fact, if I am lucky this will make the whole thing a bit simpler. I don't understand this 0 case though - is it a bug? ian@majestica:~% export PS1="%10>-->0--------%<< " 0-------- export PS1="%10>-->10--------%<< " 10-------- export PS1="%10>-->100--------%<< " 100------- export PS1="%10>-->1000--------%<< " 1000------ echo $ZSH_VERSION 4.0.4 Thanks Ian