From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18285 invoked from network); 5 Dec 2007 17:29:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Dec 2007 17:29:17 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 42199 invoked from network); 5 Dec 2007 17:29:08 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Dec 2007 17:29:08 -0000 Received: (qmail 25780 invoked by alias); 5 Dec 2007 17:29:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24163 Received: (qmail 25764 invoked from network); 5 Dec 2007 17:29:03 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Dec 2007 17:29:03 -0000 Received: (qmail 41744 invoked from network); 5 Dec 2007 17:29:03 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 5 Dec 2007 17:28:56 -0000 Received: from rly09d.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly09d.srv.mailcontrol.com (MailControl) with ESMTP id lB5HSrOJ014089 for ; Wed, 5 Dec 2007 17:28:53 GMT Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly09d.srv.mailcontrol.com (MailControl) id lB5HSMjB007900 for zsh-workers@sunsite.dk; Wed, 5 Dec 2007 17:28:22 GMT Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly09d-eth0.srv.mailcontrol.com (envelope-sender Peter.Stephenson@csr.com) (MIMEDefang) with ESMTP id lB5HSLvo007345; Wed, 05 Dec 2007 17:28:22 +0000 (GMT) Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Wed, 5 Dec 2007 17:28:21 +0000 Date: Wed, 5 Dec 2007 17:28:21 +0000 From: Peter Stephenson To: nico@codernet.org (Nico R. Wohlgemuth), zsh-workers@sunsite.dk Subject: Re: Strange bug with tiling wm, urxvt and zsh Message-ID: <20071205172821.32674415@news01> In-Reply-To: <20071205162501.GA13383@codernet.org> References: <20071205141643.GA19714@codernet.org> <20071205145627.71476067@news01> <20071205162501.GA13383@codernet.org> Organization: CSR X-Mailer: Claws Mail 3.0.2 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Dec 2007 17:28:21.0609 (UTC) FILETIME=[3B975590:01C83764] X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.68.1.119 On Wed, 5 Dec 2007 17:25:01 +0100 nico@codernet.org (Nico R. Wohlgemuth) wrote: > The patch (sadly) does not solve the problem. OK, that means (E&OE) that the rows and columns are set correctly when we get to zle. Next guess: the SIGWINCH is happening too early, before we've set up the terminal, so that adjustwinsize() is being called but is doing the wrong thing. The following patch stops adjustwinsize() from doing anything until we're sure it's OK which is at the call during normal initialization. Index: Src/jobs.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/jobs.c,v retrieving revision 1.60 diff -u -r1.60 jobs.c --- Src/jobs.c 5 Sep 2007 16:16:17 -0000 1.60 +++ Src/jobs.c 5 Dec 2007 17:22:05 -0000 @@ -379,7 +379,7 @@ if (somestopped || (pgrp > 1 && kill(-pgrp, 0) == -1)) { attachtty(mypgrp); /* check window size and adjust if necessary */ - adjustwinsize(0); + adjustwinsize(4); } else { /* * Oh, dear, we're right in the middle of some confusion @@ -406,7 +406,7 @@ } else { attachtty(mypgrp); /* check window size and adjust if necessary */ - adjustwinsize(0); + adjustwinsize(4); } } } else if (list_pipe && (val & 0200) && inforeground == 1 && @@ -1067,7 +1067,7 @@ deletefilelist(jn->filelist); if (jn->stat & STAT_ATTACH) { attachtty(mypgrp); - adjustwinsize(0); + adjustwinsize(4); } freejob(jn, 1); Index: Src/utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/utils.c,v retrieving revision 1.172 diff -u -r1.172 utils.c --- Src/utils.c 3 Dec 2007 22:46:11 -0000 1.172 +++ Src/utils.c 5 Dec 2007 17:22:06 -0000 @@ -1504,21 +1504,37 @@ } /* check the size of the window and adjust if necessary. * - * The value of from: * - * 0: called from update_job or setupvals * - * 1: called from the SIGWINCH handler * - * 2: called from the LINES parameter callback * - * 3: called from the COLUMNS parameter callback */ + * The value of from: * + * 0: called from setupvals * + * 1: called from the SIGWINCH handler * + * 2: called from the LINES parameter callback * + * 3: called from the COLUMNS parameter callback * + * 4: called from update_job */ /**/ void adjustwinsize(int from) { + static int init_ok = 0; static int getwinsz = 1; int ttyrows = shttyinfo.winsize.ws_row; int ttycols = shttyinfo.winsize.ws_col; int resetzle = 0; + if (!init_ok) { + /* + * We don't set up until the call from setupvals(). + */ + if (from) + return; + init_ok = 1; + } + /* + * The call from update_job() behaves the same as the initial call. + */ + if (from == 4) + from = 0; + if (getwinsz || from == 1) { #ifdef TIOCGWINSZ if (SHTTY == -1) -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070