From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4823 invoked from network); 5 Dec 2007 16:25:27 -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.6 required=5.0 tests=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 16:25:27 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 6955 invoked from network); 5 Dec 2007 16:25:15 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Dec 2007 16:25:15 -0000 Received: (qmail 4921 invoked by alias); 5 Dec 2007 16:25:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24162 Received: (qmail 4891 invoked from network); 5 Dec 2007 16:25:08 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Dec 2007 16:25:08 -0000 Received: (qmail 6593 invoked from network); 5 Dec 2007 16:25:08 -0000 Received: from 0x60.org (62.75.156.113) by a.mx.sunsite.dk with SMTP; 5 Dec 2007 16:25:03 -0000 Received: by 0x60.org (Postfix, from userid 65001) id 1ECAFA460040; Wed, 5 Dec 2007 17:25:02 +0100 (CET) Date: Wed, 5 Dec 2007 17:25:01 +0100 To: zsh-workers@sunsite.dk Subject: Re: Strange bug with tiling wm, urxvt and zsh Message-ID: <20071205162501.GA13383@codernet.org> References: <20071205141643.GA19714@codernet.org> <20071205145627.71476067@news01> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071205145627.71476067@news01> User-Agent: Mutt/1.5.13 (2006-08-11) From: nico@codernet.org (Nico R. Wohlgemuth) On 14:56 Wed 05 Dec , Peter Stephenson wrote: > On Wed, 5 Dec 2007 15:16:44 +0100 > nico@codernet.org (Nico R. Wohlgemuth) wrote: > > Everytime I open a window it gets resized to fit the screen (which is > > the job of a tiling wm). Now, If I open a terminal window, dwm resizes it > > directly to fit the screen - after that the first prompt I get is > > 'unusable'. > ... > > I have tested a bit around and someone from #zsh gave me a dirty hack to > > bypass this behaviour: "sleep 0.1 && kill -SIGWINCH $$" at the end of the > > .zshrc - which works but is very dirty and only a termporaly solution for > > this. > > (Moved to zsh-workers; I don't think there are any user-serviceable parts > inside.) > > If this fixes the problem, it means zsh isn't receiving or (more likely) > handling a SIGWINCH generated while it's starting up which is when the > window is resized. > > Can you try the following patch? I'm not entirely sure of its possible > ramifications (though it doesn't look like it should cause new problems) > but it would at least be useful to find out if it helps. > > 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 14:48:44 -0000 > @@ -1506,12 +1506,12 @@ > /* 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 * > + * 1: called from the SIGWINCH handler (or faked) * > * 2: called from the LINES parameter callback * > * 3: called from the COLUMNS parameter callback */ > > /**/ > -void > +mod_export void > adjustwinsize(int from) > { > static int getwinsz = 1; > Index: Src/Zle/zle_main.c > =================================================================== > RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v > retrieving revision 1.100 > diff -u -r1.100 zle_main.c > --- Src/Zle/zle_main.c 19 Oct 2007 01:33:09 -0000 1.100 > +++ Src/Zle/zle_main.c 5 Dec 2007 14:48:44 -0000 > @@ -1106,6 +1106,22 @@ > if (termflags & TERM_UNKNOWN) > init_term(); > } > +#ifdef TIOCGWINSZ > + { > + struct winsize winsize; > + /* > + * We may not handle window changes that happened while the > + * shell was starting up. Just before we draw the prompt, > + * do this fairly cheap test to see if we need to fake a > + * SIGWINCH. > + */ > + if (ioctl(SHTTY, TIOCGWINSZ, (char *)&winsize) == 0) { > + if (shttyinfo.winsize.ws_row != winsize.ws_row || > + shttyinfo.winsize.ws_col != winsize.ws_col) > + adjustwinsize(1); > + } > + } > +#endif > > fflush(shout); > fflush(stderr); > > > > -- > Peter Stephenson Software Engineer > CSR PLC, Churchill House, Cambridge Business Park, Cowley Road > Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 The patch (sadly) does not solve the problem. -- regards, Nico R. Wohlgemuth