diff options
author | Russ Cox <rsc@swtch.com> | 2008-11-13 15:39:56 -0800 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2008-11-13 15:39:56 -0800 |
commit | e1118cf27c9f66dfc90d2ead51a25602335bf9bf (patch) | |
tree | de803db5c9218df88e00a82b7d771c293cefb4ce | |
parent | fa580e2116da0709c1e48b280722f0c18ef3fd73 (diff) | |
download | plan9port-e1118cf27c9f66dfc90d2ead51a25602335bf9bf.tar.gz plan9port-e1118cf27c9f66dfc90d2ead51a25602335bf9bf.tar.bz2 plan9port-e1118cf27c9f66dfc90d2ead51a25602335bf9bf.zip |
win: implement Scroll and Noscroll
-rw-r--r-- | src/cmd/9term/win.c | 14 |
1 files changed, 13 insertions, 1 deletions
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); |