From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12172 invoked from network); 26 Feb 2002 16:48:55 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Feb 2002 16:48:55 -0000 Received: (qmail 13725 invoked by alias); 26 Feb 2002 16:48:42 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4694 Received: (qmail 13713 invoked from network); 26 Feb 2002 16:48:42 -0000 To: zsh-users@sunsite.dk (Zsh users list) Subject: Re: Length of %? in prompt In-reply-to: "Ian Lynagh"'s message of "Tue, 26 Feb 2002 16:05:03 GMT." <20020226160503.GA15163@stu163.keble.ox.ac.uk> Date: Tue, 26 Feb 2002 16:48:13 +0000 Message-ID: <7059.1014742093@csr.com> From: Peter Stephenson 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 :-( I haven't understood quite what you're trying to do, but you might be able to use truncation. "%10>>anything%>>something else" will limit `anything', whatever it expands to (it can include arbitrary prompt escapes but also any other text), to 10 characters, truncating on ther right. Truncation is then turned off so that `something else' will be output in full. So to keep the length the same you can arrange for `anything' to end with an arbitrarily large string of characters which will be pruned to the right size. This assumes zsh 4. The truncation in older versions was less flexible --- only the replacement text for prompt escapes was truncated. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************