aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-11-06 22:22:54 +0000
committerrsc <devnull@localhost>2005-11-06 22:22:54 +0000
commit10ab06a791c2ed5cccd8ab7e24fb435997b7a47a (patch)
treefeb6c8981326e3bbd8df3e3f8d0770487bf498bb /src/cmd/9term
parente830a908498c8f0270948fd08c50f6d773315880 (diff)
downloadplan9port-10ab06a791c2ed5cccd8ab7e24fb435997b7a47a.tar.gz
plan9port-10ab06a791c2ed5cccd8ab7e24fb435997b7a47a.tar.bz2
plan9port-10ab06a791c2ed5cccd8ab7e24fb435997b7a47a.zip
handle interrupts
Diffstat (limited to 'src/cmd/9term')
-rw-r--r--src/cmd/9term/9term.c10
-rw-r--r--src/cmd/9term/fns.h1
-rw-r--r--src/cmd/9term/wind.c12
3 files changed, 13 insertions, 10 deletions
diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c
index 285878e8..c610e046 100644
--- a/src/cmd/9term/9term.c
+++ b/src/cmd/9term/9term.c
@@ -419,6 +419,16 @@ rcoutputproc(void *arg)
}
}
+void
+winterrupt(Window *w)
+{
+ char rubout[1];
+
+ USED(w);
+ rubout[0] = getintr(sfd);
+ write(rcfd, rubout, 1);
+}
+
/*
* Process in-band messages about window title changes.
* The messages are of the form:
diff --git a/src/cmd/9term/fns.h b/src/cmd/9term/fns.h
index 9fc30933..2d31ad88 100644
--- a/src/cmd/9term/fns.h
+++ b/src/cmd/9term/fns.h
@@ -30,6 +30,7 @@ char* runetobyte(Rune*, int, int*);
void timerinit(void);
int goodrect(Rectangle);
int rawon(void);
+void winterrupt(Window*);
#define runemalloc(n) malloc((n)*sizeof(Rune))
#define runerealloc(a, n) realloc(a, (n)*sizeof(Rune))
diff --git a/src/cmd/9term/wind.c b/src/cmd/9term/wind.c
index 600a4e42..781a91d5 100644
--- a/src/cmd/9term/wind.c
+++ b/src/cmd/9term/wind.c
@@ -563,7 +563,6 @@ wkeyctl(Window *w, Rune r)
uint q0 ,q1;
int n, nb, nr;
Rune *rp;
- int *notefd;
if(r == 0)
return;
@@ -665,9 +664,7 @@ wkeyctl(Window *w, Rune r)
case 0x7F: /* send interrupt */
w->qh = w->nr;
wshow(w, w->qh);
- notefd = emalloc(sizeof(int));
- *notefd = w->notefd;
- proccreate(interruptproc, notefd, 4096);
+ winterrupt(w);
return;
case 0x06: /* ^F: file name completion */
case Kins: /* Insert: file name completion */
@@ -1294,19 +1291,14 @@ void
wsetpid(Window *w, int pid, int dolabel)
{
char buf[128];
- int fd;
w->pid = pid;
if(dolabel){
sprint(buf, "rc %d", pid);
free(w->label);
w->label = estrdup(buf);
+ drawsetlabel(w->label);
}
- sprint(buf, "/proc/%d/notepg", pid);
- fd = open(buf, OWRITE|OCEXEC);
- if(w->notefd > 0)
- close(w->notefd);
- w->notefd = fd;
}
static Rune left1[] = { '{', '[', '(', '<', 0xAB, 0 };