From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17870 invoked from network); 1 Jul 2006 18:25:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 Jul 2006 18:25:29 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 46772 invoked from network); 1 Jul 2006 18:25:21 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Jul 2006 18:25:21 -0000 Received: (qmail 29664 invoked by alias); 1 Jul 2006 18:25:13 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10464 Received: (qmail 29655 invoked from network); 1 Jul 2006 18:25:13 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 1 Jul 2006 18:25:13 -0000 Received: (qmail 45653 invoked from network); 1 Jul 2006 18:25:13 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 1 Jul 2006 18:25:12 -0000 Received: from torch.brasslantern.com ([71.116.74.94]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J1Q004S2LTYO2I0@vms040.mailsrvcs.net> for zsh-users@sunsite.dk; Sat, 01 Jul 2006 13:25:11 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k61IP9Gr024580 for ; Sat, 01 Jul 2006 11:25:10 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k61IP9r6024579 for zsh-users@sunsite.dk; Sat, 01 Jul 2006 11:25:09 -0700 Date: Sat, 01 Jul 2006 11:25:09 -0700 From: Bart Schaefer Subject: Re: Prompt truncating, redux In-reply-to: <3E1F24BF-0332-4A29-9F54-5A3F0D24484E@petmystone.com> To: zsh-users Message-id: <060701112509.ZM24578@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <3E1F24BF-0332-4A29-9F54-5A3F0D24484E@petmystone.com> Comments: In reply to Timothy Stone "Prompt truncating, redux" (Jul 1, 11:35am) On Jul 1, 11:35am, Timothy Stone wrote: } } I figured out the expectations of zsh v. tcsh, save "set ellipsis"... } zsh seems to be able to do this, but I can't sort out the syntax } using '%<...<%/' The ellipsis syntax in zsh truncates everything up to either the end of the prompt or the next truncation marker. It also truncates at a set number of characters, rather than (e.g.) a set number of directory levels in a path hierarchy. So you can say %20<...<%/%<< to get ellipsis followed by 20 characters of the tail of the path, but that doesn't promise to show you three directories if the last one or two are more than 20 characters long in total. What you appear to want is conditional syntax, not truncation syntax: %4(c:...:)%3c will show elipses if %c is at least 4 path elements long, nothing if it is less than 4 elements long, followed by the last 3 elements of %c.