aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term
diff options
context:
space:
mode:
authorFazlul Shahriar <fshahriar@gmail.com>2010-01-05 14:31:27 -0800
committerRuss Cox <rsc@swtch.com>2010-01-05 14:31:27 -0800
commit6a6c2663bfd42eab68cc53c42a499798ae6332a3 (patch)
tree4a37ad69b6ca2485995b87b216022279ca0c6189 /src/cmd/9term
parent7d9c0f0f0e041051d3105404ada074cf983cd6ad (diff)
downloadplan9port-6a6c2663bfd42eab68cc53c42a499798ae6332a3.tar.gz
plan9port-6a6c2663bfd42eab68cc53c42a499798ae6332a3.tar.bz2
plan9port-6a6c2663bfd42eab68cc53c42a499798ae6332a3.zip
win fixes
- don't exit from a "child" note unless rc exited (code copied from 9term.c) - ignore writes to the tag; specifically " Send Noscroll" at startup. R=rsc CC=codebot http://codereview.appspot.com/181115
Diffstat (limited to 'src/cmd/9term')
-rw-r--r--src/cmd/9term/win.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/cmd/9term/win.c b/src/cmd/9term/win.c
index 6d4349ba..926d806b 100644
--- a/src/cmd/9term/win.c
+++ b/src/cmd/9term/win.c
@@ -108,8 +108,16 @@ hangupnote(void *a, char *msg)
noted(NDFLT);
}
if(strstr(msg, "child")){
- /* bug: do better */
- threadexitsall(0);
+ char buf[128];
+ int n;
+
+ n = awaitnohang(buf, sizeof buf-1);
+ if(n > 0){
+ buf[n] = 0;
+ if(atoi(buf) == pid)
+ threadexitsall(0);
+ }
+ noted(NCONT);
}
noted(NDFLT);
}
@@ -357,10 +365,22 @@ stdinproc(void *v)
print("unknown message %c%c\n", e.c1, e.c2);
break;
- case 'E': /* write to body; can't affect us */
- if(debug)
- fprint(2, "shift typing %d... ", e.q1-e.q0);
- q.p += e.q1-e.q0;
+ case 'E': /* write to body or tag; can't affect us */
+ switch(e.c2){
+ case 'I':
+ case 'D': /* body */
+ if(debug)
+ fprint(2, "shift typing %d... ", e.q1-e.q0);
+ q.p += e.q1-e.q0;
+ break;
+
+ case 'i':
+ case 'd': /* tag */
+ break;
+
+ default:
+ goto Unknown;
+ }
break;
case 'F': /* generated by our actions; ignore */