diff options
author | rwatson <rwatson@FreeBSD.org> | 2001-11-07 19:15:19 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2001-11-07 19:15:19 +0000 |
commit | 23eb56f57ba984bdb695b66890b3bb4567b73381 (patch) | |
tree | d778b90686156df000ffa35ad40eb4c772027ef7 /usr.sbin/watch | |
parent | 5c86756d5cf36e038608ab2591f6cb6b48484e69 (diff) | |
download | FreeBSD-src-23eb56f57ba984bdb695b66890b3bb4567b73381.zip FreeBSD-src-23eb56f57ba984bdb695b66890b3bb4567b73381.tar.gz |
o When "-n" is used with watch, it disables the use of <control-X> to
change terminals being watched. This change makes watch pass the
<control-X> through to the terminal if it's not being intercepted--
previously, the keypress would simply be dropped.
Diffstat (limited to 'usr.sbin/watch')
-rw-r--r-- | usr.sbin/watch/watch.8 | 4 | ||||
-rw-r--r-- | usr.sbin/watch/watch.c | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/watch/watch.8 b/usr.sbin/watch/watch.8 index e01257ae..56b7343 100644 --- a/usr.sbin/watch/watch.8 +++ b/usr.sbin/watch/watch.8 @@ -54,6 +54,7 @@ would be displayed, .Nm will exit. The reconnect flags are unaffected by this option. +When this flag is used, <control-X> is passed through to the terminal. .It Fl W Allow write access to observed tty. .It Ar tty @@ -72,7 +73,8 @@ Exit .It Sy "<control-W>" Clear screen. .It Sy "<control-X>" -Change attached tty. +Change attached tty, unless this feature is disabled, in which case +control-X is passed to the terminal as with other control characters. .El .Sh RESTRICTIONS Only the superuser can run diff --git a/usr.sbin/watch/watch.c b/usr.sbin/watch/watch.c index 710adbf..4d1c38d 100644 --- a/usr.sbin/watch/watch.c +++ b/usr.sbin/watch/watch.c @@ -371,12 +371,12 @@ main(ac, av) clear(); break; case CHR_SWITCH: - if (opt_no_switch) + if (!opt_no_switch) { + detach_snp(); + ask_dev(dev_name, MSG_CHANGE); + set_dev(dev_name); break; - detach_snp(); - ask_dev(dev_name, MSG_CHANGE); - set_dev(dev_name); - break; + } default: if (opt_write) { rv = write(snp_io, chb, nread); |