summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/watch/watch.84
-rw-r--r--usr.sbin/watch/watch.c10
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);
OpenPOWER on IntegriCloud