From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26254 invoked from network); 6 Oct 2006 09:42:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.6 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Oct 2006 09:42:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 74539 invoked from network); 6 Oct 2006 09:42:41 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Oct 2006 09:42:41 -0000 Received: (qmail 20020 invoked by alias); 6 Oct 2006 09:42:30 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10790 Received: (qmail 20011 invoked from network); 6 Oct 2006 09:42:30 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Oct 2006 09:42:30 -0000 Received: (qmail 73022 invoked from network); 6 Oct 2006 09:42:30 -0000 Received: from cluster-c.mailcontrol.com (168.143.177.190) by a.mx.sunsite.dk with SMTP; 6 Oct 2006 09:42:25 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly24c.srv.mailcontrol.com (MailControl) with ESMTP id k969ebar007980 for ; Fri, 6 Oct 2006 10:42:21 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Fri, 6 Oct 2006 10:41:39 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.7/8.13.4) with ESMTP id k969fcP4017813 for ; Fri, 6 Oct 2006 10:41:38 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.7/8.13.7/Submit) with ESMTP id k969fbIw017806 for ; Fri, 6 Oct 2006 10:41:38 +0100 Message-Id: <200610060941.k969fbIw017806@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh users Subject: Re: _all_matches moves cursor In-reply-to: <20061006051215.GA12364@mollari.zhar.net> References: <20061006051215.GA12364@mollari.zhar.net> Comments: In-reply-to John Eikenberry message dated "Fri, 06 Oct 2006 01:12:15 -0400." Date: Fri, 06 Oct 2006 10:41:37 +0100 From: Peter Stephenson X-OriginalArrivalTime: 06 Oct 2006 09:41:39.0255 (UTC) FILETIME=[9F537470:01C6E92B] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-04-02 (www.mailcontrol.com) on 10.67.0.134 John Eikenberry wrote: > I recently added _all_matches to my completion config [1] and have come > across an annoying behaviour. When the '- all matches -' line is longer > than my terminal is wide, the cursor (along with the command being > completed) gets bounced down a line. I found this in the latest code, and assumed it was due to my recent changes, but I guessed you were using 4.2.x, and sure enough, unless the shell is lying to me, it's there too. Here's a slight cheat that simply shortens the line being added. I haven't the moral fibre to go back into the line-length calculations in the completion system at the moment, but my conscience is easier since the following is definitely safe with any form of terminal, whatever it does when the character reaches the end of the line, and also prevents a blank line appearing at the bottom of the screen. I suspect, however, the real problem is a calculation inside zsh rather than the terminal's behaviour. Further discussion of this ought to go on zsh-workers since it's down to the internals, not John's settings. Index: Src/Zle/compresult.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/compresult.c,v retrieving revision 1.65 diff -u -r1.65 compresult.c --- Src/Zle/compresult.c 11 Aug 2006 21:30:38 -0000 1.65 +++ Src/Zle/compresult.c 6 Oct 2006 09:30:43 -0000 @@ -2134,7 +2134,7 @@ strcat(buf, " "); strncat(buf, m->str, len); } - strcat(buf, " ..."); + strcat(buf, " .."); break; } } -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php