diff options
author | jkh <jkh@FreeBSD.org> | 1996-03-01 18:21:41 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-03-01 18:21:41 +0000 |
commit | 2dac23e9f496bd5dc0a82b65d5a5767f36b77fb3 (patch) | |
tree | fa0f623a31caff9c379351923b7837b06d23c42c /usr.sbin | |
parent | e01d4a02fc48271458559a51cf06931b405d8e8a (diff) | |
download | FreeBSD-src-2dac23e9f496bd5dc0a82b65d5a5767f36b77fb3.zip FreeBSD-src-2dac23e9f496bd5dc0a82b65d5a5767f36b77fb3.tar.gz |
Properly save and restore the terminal characters!
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/watch/watch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/watch/watch.c b/usr.sbin/watch/watch.c index 20c93cf..a145916 100644 --- a/usr.sbin/watch/watch.c +++ b/usr.sbin/watch/watch.c @@ -57,6 +57,7 @@ int std_in = 0, std_out = 1; int clear_ok = 0; struct sgttyb sgo; +struct tchars tco; char tbuf[1024], buf[1024]; @@ -91,9 +92,9 @@ set_tty() struct tchars tc; ioctl(std_in, TIOCGETP, &sgo); - ioctl(std_in, TIOCGETC, &tc); - /* bcopy(&sgn, &sgo, sizeof(struct sgttyb)); */ + ioctl(std_in, TIOCGETC, &tco); sgn = sgo; + tc = tco; sgn.sg_flags |= CBREAK; sgn.sg_flags &= ~ECHO; ospeed = sgo.sg_ospeed; @@ -107,6 +108,7 @@ void unset_tty() { ioctl(std_in, TIOCSETP, &sgo); + ioctl(std_in, TIOCSETC, &tco); } |