#51 Resize race condition at startup

open
nobody
None
5
2004-06-29
2004-06-29
Anonymous
No

With a new rxvt window, "stty size" sometimes says "24
80", sometimes "29 80".

I'm using ratpoison window manager with a frame
suitable for 80x29. At startup, ratpoison
immediately tells the application to resize to fill its
frame. Rxvt always fills the frame, but *sometimes*
the window size doesn't get updated in the kernel.
Subsequent resizing works fine.

No big deal, as I'm just using "resize" in my .rc file,
but it looks like a bug.

This is on Debian testing, and I've had the behaviour
with both rxvt 2.6.4 and 2.7.10.

Robert Swan.

Feel free to contact me: roberts@insite.didata.com.au

Discussion

  • Logged In: NO

    it's not the kernel that doesn't get updated, but there is a race condition between rxvt beeing resized and the shell in the terminal being notified, so the shell doesnt get a notification about the size changing (try kill -WINCH $$)

     
  • --- src/init.c.orig Sat Aug 21 00:30:38 2010
    +++ src/init.c Sat Aug 21 00:30:56 2010
    @@ -1316,6 +1316,9 @@
    /* need to trap SIGURG for SVR4 (Unixware) rlogin */
    /* signal (SIGURG, SIG_DFL); */

    +/* set window size */
    + rxvt_tt_winsize(STDIN_FILENO, r->TermWin.ncol,
    r->TermWin.nrow);
    +
    #ifndef __QNX__
    /* spin off the command interpreter */
    switch (r->h->cmd_pid = fork()) {
    @@ -1398,9 +1401,6 @@
    }
    #endif /* SRIOCSREDIR */
    }
    -
    - /* set window size */
    - rxvt_tt_winsize(STDIN_FILENO, r->TermWin.ncol,
    r->TermWin.nrow);

    /* reset signals and spin off the command interpreter */
    signal(SIGINT, SIG_DFL);