- /*
- * Handle SIGWINCH's with in-band signaling of new
- * window size. It seems reasonable that we flush
- * pending input and not force out of band signal
- * as this most likely will occur from an input device
- * other than the keyboard (e.g. a mouse).
- *
- * The hack of using 0377 to signal an in-band signal
- * is pretty bad, but otherwise we'd be forced to
- * either get complicated (use MSG_OOB) or go to a
- * serious (telnet-style) protocol.
- */
- if (setjmp(winsizechanged)) {
- struct winsize *wp = (struct winsize *)(obuf+4);
-
- obuf[0] = 0377; /* XXX */
- obuf[1] = 0377; /* XXX */
- obuf[2] = 's'; /* XXX */
- obuf[3] = 's'; /* XXX */
- wp->ws_row = htons(winsize.ws_row);
- wp->ws_col = htons(winsize.ws_col);
- wp->ws_xpixel = htons(winsize.ws_xpixel);
- wp->ws_ypixel = htons(winsize.ws_ypixel);
- (void) write(rem, obuf, 4+sizeof (*wp));
- }
-top:
- op = obuf;