diff options
author | rsc <devnull@localhost> | 2005-11-30 02:31:55 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-11-30 02:31:55 +0000 |
commit | baa6e34b72e5d978fb0da4266c4527e7e582e675 (patch) | |
tree | 00c2db89261868832509f8945fe898ef46ce46d6 /src/cmd/9term | |
parent | 02dc681a9824cade538b0f2f5db987733d29e9c0 (diff) | |
download | plan9port-baa6e34b72e5d978fb0da4266c4527e7e582e675.tar.gz plan9port-baa6e34b72e5d978fb0da4266c4527e7e582e675.tar.bz2 plan9port-baa6e34b72e5d978fb0da4266c4527e7e582e675.zip |
set window params on startup
Diffstat (limited to 'src/cmd/9term')
-rw-r--r-- | src/cmd/9term/9term.c | 8 | ||||
-rw-r--r-- | src/cmd/9term/bsdpty.c | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c index 46a852bd..c2bd7766 100644 --- a/src/cmd/9term/9term.c +++ b/src/cmd/9term/9term.c @@ -174,15 +174,17 @@ resizethread(void *v) USED(v); - while(recv(mousectl->resizec, nil) == 1){ - if(getwindow(display, Refnone) < 0) - sysfatal("can't reattach to window"); + for(;;){ p = stringsize(display->defaultfont, "0"); if(p.x && p.y) updatewinsize(Dy(screen->r)/p.y, (Dx(screen->r)-Scrollwid-2)/p.x, Dx(screen->r), Dy(screen->r)); wresize(w, screen, 0); flushimage(display, 1); + if(recv(mousectl->resizec, nil) != 1) + break; + if(getwindow(display, Refnone) < 0) + sysfatal("can't reattach to window"); } } diff --git a/src/cmd/9term/bsdpty.c b/src/cmd/9term/bsdpty.c index 915836a8..52b9bb8a 100644 --- a/src/cmd/9term/bsdpty.c +++ b/src/cmd/9term/bsdpty.c @@ -76,9 +76,10 @@ updatewinsize(int row, int col, int dx, int dy) ws.ws_col = col; ws.ws_xpixel = dx; ws.ws_ypixel = dy; - if(ws.ws_row != ows.ws_row || ws.ws_col != ows.ws_col) - if(ioctl(rcfd, TIOCSWINSZ, &ws) < 0) - fprint(2, "ioctl: %r\n"); + if(ws.ws_row != ows.ws_row || ws.ws_col != ows.ws_col){ + if(ioctl(rcfd, TIOCSWINSZ, &ws) < 0) + fprint(2, "ioctl: %r\n"); + } ows = ws; } |