summaryrefslogtreecommitdiffstats
path: root/usr.sbin/watch/watch.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-12-16 10:07:10 +0000
committerjkh <jkh@FreeBSD.org>1995-12-16 10:07:10 +0000
commitd4004feaeed42483a6da5927ebbc1890e107355f (patch)
tree773a7201747346a4e46fb38c2b7a4657cc91ffb5 /usr.sbin/watch/watch.c
parent2d2185e129a0b9591326cf6780f33103e6daf487 (diff)
downloadFreeBSD-src-d4004feaeed42483a6da5927ebbc1890e107355f.zip
FreeBSD-src-d4004feaeed42483a6da5927ebbc1890e107355f.tar.gz
Map ^C and ^\ (INTR and QUIT) to ^Q so that you can actually send these
guys to a watched process. Useful if you're monitoring someone who's started doing something you'd really like them to stop immediately. :) Suggested by: Phillip White <philw@megasoft.tic.ab.ca>
Diffstat (limited to 'usr.sbin/watch/watch.c')
-rw-r--r--usr.sbin/watch/watch.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.sbin/watch/watch.c b/usr.sbin/watch/watch.c
index 620d7961..20c93cf 100644
--- a/usr.sbin/watch/watch.c
+++ b/usr.sbin/watch/watch.c
@@ -88,13 +88,19 @@ void
set_tty()
{
struct sgttyb sgn;
+ struct tchars tc;
+
ioctl(std_in, TIOCGETP, &sgo);
+ ioctl(std_in, TIOCGETC, &tc);
/* bcopy(&sgn, &sgo, sizeof(struct sgttyb)); */
sgn = sgo;
sgn.sg_flags |= CBREAK;
sgn.sg_flags &= ~ECHO;
ospeed = sgo.sg_ospeed;
+ tc.t_intrc = 17; /* ^Q */
+ tc.t_quitc = 17; /* ^Q */
ioctl(std_in, TIOCSETP, &sgn);
+ ioctl(std_in, TIOCSETC, &tc);
}
void
OpenPOWER on IntegriCloud