From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6372 invoked from network); 4 Oct 2005 17:13:34 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Oct 2005 17:13:34 -0000 Received: (qmail 47370 invoked from network); 4 Oct 2005 17:13:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Oct 2005 17:13:28 -0000 Received: (qmail 5516 invoked by alias); 4 Oct 2005 17:13:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21836 Received: (qmail 5506 invoked from network); 4 Oct 2005 17:13:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Oct 2005 17:13:25 -0000 Received: (qmail 47145 invoked from network); 4 Oct 2005 17:13:25 -0000 Received: from ns9.hostinglmi.net (213.194.149.146) by a.mx.sunsite.dk with SMTP; 4 Oct 2005 17:13:23 -0000 Received: from 212.red-80-35-44.staticip.rima-tde.net ([80.35.44.212] helo=localhost) by ns9.hostinglmi.net with esmtpa (Exim 4.52) id 1EMqM0-0005wW-8n; Tue, 04 Oct 2005 19:13:24 +0200 Date: Tue, 4 Oct 2005 19:13:51 +0200 From: DervishD To: Bart Schaefer Cc: Zsh Workers Subject: Re: Bug? in complist when filenames are longer than the screen Message-ID: <20051004171351.GB20791@DervishD> Mail-Followup-To: Bart Schaefer , Zsh Workers References: <20051003144536.GA3179@DervishD> <1051004161114.ZM32268@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1051004161114.ZM32268@candle.brasslantern.com> User-Agent: Mutt/1.4.2.1i Organization: DervishD X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ns9.hostinglmi.net X-AntiAbuse: Original Domain - sunsite.dk X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - dervishd.net X-Source: X-Source-Args: X-Source-Dir: X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 Hi Bart :) * Bart Schaefer dixit: > On Oct 3, 4:45pm, DervishD wrote: > } $ touch a b c filename1 filename2 d e > } $ zmodload zsh/complist > } $ COLUMNS=3 > I didn't look at this all that closely before, but it's not at all > surprising that the display gets messed up when COLUMNS is not the > same as the actual width of the window. The complist module relies > on the terminal emulator to have wrapped long lines, etc., when > they were output; it does not insert its own line breaks at an > imaginary window boundary. (ZLE sometimes appears to do so, but it > has a lot of extra smarts regarding terminals that don't > auto-scroll, very few of which smarts were ever incorporated into > complist.) OK, but I used COLUMNS=3 just to avoid to "touch" very long file names. The problem is the same here with "COLUMS=100" (the default in my system) and very long file names, even without a long prompt. > Are you sure you don't mean MENUSELECT=3 in that example? If you > have never set MENUSELECT, then loading the zsh/complist module is > not going to have any effect, and in this next step ... No, I'm sure. When testing, I didn't set up MENUSELECT, but I'm afraid it got inherited from the login shell :((( with a value of 0. I'm going to make another test, using a clean environment. OK, here are the results with the UNPATCHED version of zsh: if I use very long names (much longer than COLUMNS), the bug doesn't happen!. It only happens with a list of files in one directory :??? Mmm, interesting, it looks like a corner case: the bug only happens when in the file listing is there a file whose name length is *exactly* $COLUMNS. Longer or shorter files doesn't cause the bug to happen. I've tested this with different prompts and in a clean environment (that is, the login shell doesn't source ANY file, because no RC file is present). I've found the bug to be repeatable with this sequence (try this in a clean zsh environment, no /etc/zshenv, no any other rcfile, and it must be a login shell, just to make sure): $ rm -rf test $ mkdir test ; cd test $ PS1= $ touch ${(l:$COLUMNS::a:):-} a b c $ zmodload zsh/complist $ MENUSELECT=0 It's very important to create the other three files (a, b and c) in the directory (otherwise you won't get a list ;)). This causes a crash, always, without looping, even with your patches. > } $ ls > ... the up/down are going to scroll through the history, not through > the completions. If you're getting a reproducible crash exactly as > described above, then it's not completion that's crashing, and we > need to be looking elsewhere. The command above runs through the completions if MENUSELECT is 0, of course. My fault, I should have carried the tests in a fully clean and default environment, not just "zsh -f", because variables and the like are inherited. Sorry :((( Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net http://www.pleyades.net & http://www.gotesdelluna.net It's my PC and I'll cry if I want to...