Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Strange bug with tiling wm, urxvt and zsh
- X-seq: zsh-workers 24161
- From: Peter Stephenson <pws@xxxxxxx>
- To: nico@xxxxxxxxxxxx (Nico R. Wohlgemuth), zsh-workers@xxxxxxxxxx
- Subject: Re: Strange bug with tiling wm, urxvt and zsh
- Date: Wed, 5 Dec 2007 14:56:27 +0000
- In-reply-to: <20071205141643.GA19714@xxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: CSR
- References: <20071205141643.GA19714@xxxxxxxxxxxx>
On Wed, 5 Dec 2007 15:16:44 +0100
nico@xxxxxxxxxxxx (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 <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author