aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/9term')
-rw-r--r--src/cmd/9term/9term.c5
-rw-r--r--src/cmd/9term/fns.h1
-rw-r--r--src/cmd/9term/wind.c5
3 files changed, 11 insertions, 0 deletions
diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c
index 5cf46dec..192a9bcf 100644
--- a/src/cmd/9term/9term.c
+++ b/src/cmd/9term/9term.c
@@ -448,6 +448,11 @@ winterrupt(Window *w)
write(rcfd, rubout, 1);
}
+int
+intrc() {
+ return getintr(sfd);
+}
+
/*
* 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 a0ae686a..196f418f 100644
--- a/src/cmd/9term/fns.h
+++ b/src/cmd/9term/fns.h
@@ -31,6 +31,7 @@ void timerinit(void);
int goodrect(Rectangle);
int rawon(void);
void winterrupt(Window*);
+int intrc();
#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 b03f15fc..7dc20443 100644
--- a/src/cmd/9term/wind.c
+++ b/src/cmd/9term/wind.c
@@ -705,6 +705,11 @@ wkeyctl(Window *w, Rune r)
wcut(w);
}
switch(r){
+ case 0x03: /* maybe send interrupt */
+ /* since ^C is so commonly used as interrupt, special case it */
+ if (intrc() != 0x03)
+ break;
+ /* fall through */
case 0x7F: /* send interrupt */
w->qh = w->nr;
wshow(w, w->qh);