From e1118cf27c9f66dfc90d2ead51a25602335bf9bf Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 13 Nov 2008 15:39:56 -0800 Subject: win: implement Scroll and Noscroll --- src/cmd/9term/win.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/cmd/9term/win.c b/src/cmd/9term/win.c index 30f819f9..2d82f5b9 100644 --- a/src/cmd/9term/win.c +++ b/src/cmd/9term/win.c @@ -171,7 +171,7 @@ threadmain(int argc, char **argv) putenv("winid", buf); sprint(buf, "%d/tag", id); fd = fsopenfd(fs, buf, OWRITE|OCEXEC); - write(fd, " Send Delete", 12); + write(fd, " Send Noscroll", 1+4+1+8); close(fd); sprint(buf, "%d/event", id); eventfd = fsopen(fs, buf, ORDWR|OCEXEC); @@ -202,6 +202,8 @@ threadmain(int argc, char **argv) fswrite(ctlfd, buf, strlen(buf)); sprint(buf, "dump %s\n", dump); fswrite(ctlfd, buf, strlen(buf)); + sprint(buf, "scroll"); + fswrite(ctlfd, buf, strlen(buf)); updatewinsize(25, 80, 0, 0); proccreate(stdoutproc, nil, STACK); @@ -402,6 +404,16 @@ stdinproc(void *v) e2.flag = e.flag; e = e2; } + char buf[100]; + snprint(buf, sizeof buf, "%.*S", e.nr, e.r); + if(cistrcmp(buf, "scroll") == 0) { + fsprint(ctlfd, "scroll\nshow"); + break; + } + if(cistrcmp(buf, "noscroll") == 0) { + fsprint(ctlfd, "noscroll"); + break; + } if(e.flag & 8){ if(e.q1 != e.q0){ sende(&e, fd0, cfd, afd, dfd, 0); -- cgit v1.2.3