From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13922 invoked by alias); 18 Jan 2014 20:20:51 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32283 Received: (qmail 19292 invoked from network); 18 Jan 2014 20:20:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140118122025.ZM9203@torch.brasslantern.com> Date: Sat, 18 Jan 2014 12:20:25 -0800 In-reply-to: <20140118003701.GZ27889@sym.noone.org> Comments: In reply to Axel Beckert "segfault in tab-completion menu if terminal is only one line tall" (Jan 18, 1:37am) References: <20140118003701.GZ27889@sym.noone.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: segfault in tab-completion menu if terminal is only one line tall MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 18, 1:37am, Axel Beckert wrote: } } 1. Open terminal emulator } } 2. Resize window so that there's only one line for the shell (i.e. } where the prompt also is). } } 3. Enter: ls (that is, begin typing the 'ls' command, then } press tabulator twice to tab complete.) I was able to reproduce if I start zsh in an 80x1 terminal emulator, but not after resizing a larger terminal where zsh is already running down to 1 line. Possibly something is getting initialized differently in the two cases. Other strange things happen if I size the window down to 1 line, try a completion, and then stretch back to a larger size again; e.g., repainting the prompt above the select menu doesn't work properly. } zstyle ':completion:*' menu select=long-list select=0 } zstyle ':completion:*' select-prompt '%SScrolling active - %l%s' Yes, those are necessary (or at least the first one is) because the crash occurs in the zsh/complist module which is used for "menu select=long". The following patch stops the crash I was able to reproduce, but there may be other ways to tickle it in different circumstances. This might also fix the prompt redisplay problem I mentioned above, but I'm not confident of my steps to reproduce that one. diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index bcf3561..b852ee9 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -2500,7 +2500,7 @@ domenuselect(Hookdef dummy, Chdata dat) mlbeg--; } } - if ((space = zterm_lines - pl - mhasstat)) + if ((space = zterm_lines - pl - mhasstat) > 0) while (mline >= mlbeg + space) if ((mlbeg += step) + space > mlines) mlbeg = mlines - space; -- Barton E. Schaefer