From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (euclid.skiles.gatech.edu [130.207.146.50]) by werple.net.au (8.7/8.7.1) with ESMTP id RAA02163 for ; Mon, 8 Jan 1996 17:55:49 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id BAA21244; Mon, 8 Jan 1996 01:23:11 -0500 (EST) Resent-Date: Mon, 8 Jan 1996 01:23:11 -0500 (EST) From: Zefram Message-Id: <16994.199601080623@stone.dcs.warwick.ac.uk> Subject: -M option for ttyctl To: zsh-workers@math.gatech.edu (Z Shell workers mailing list) Date: Mon, 8 Jan 1996 06:23:17 +0000 (GMT) X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]6866.33 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"1ksWA1.0.sB5.EXBym"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/719 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- This simple patch adds the previously discussed -M option to ttyctl. I intend to add -M to all builtins for which it is meaningful. -zefram *** 1.4 1996/01/07 03:53:14 --- Src/builtin.c 1996/01/08 06:05:18 *************** *** 5191,5202 **** int bin_ttyctl(char *name, char **argv, char *ops, int func) { ! if (!ops['@']) ! printf("tty is %sfrozen\n", ttyfrozen ? "" : "not "); ! else if (ops['f']) ttyfrozen = 1; ! else ttyfrozen = 0; return 0; } --- 5191,5207 ---- int bin_ttyctl(char *name, char **argv, char *ops, int func) { ! if(ops['f'] && ops['u']) { ! zerrnam(name, "illegal combination of options", NULL, 0); ! return 1; ! } else if (ops['f']) ttyfrozen = 1; ! else if (ops['u']) ttyfrozen = 0; + else if (ops['M']) + printf("ttyctl -%c\n", ttyfrozen ? 'f' : 'u'); + else + printf("tty is %sfrozen\n", ttyfrozen ? "" : "not "); return 0; } *** 1.2 1996/01/07 02:09:24 --- Src/hashtable.h 1996/01/08 05:58:54 *************** *** 304,310 **** {NULL, "source", 0, bin_dot, 1, -1, 0, NULL, NULL}, {NULL, "suspend", 0, bin_suspend, 0, 0, 0, "f", NULL}, {NULL, "test", 0, bin_test, 0, -1, BIN_TEST, NULL, NULL}, ! {NULL, "ttyctl", 0, bin_ttyctl, 0, 0, 0, "fu", NULL}, {NULL, "times", 0, bin_times, 0, 0, 0, NULL, NULL}, {NULL, "trap", 0, bin_trap, 0, -1, 0, NULL, NULL}, {NULL, "true", 0, bin_true, 0, -1, 0, NULL, NULL}, --- 304,310 ---- {NULL, "source", 0, bin_dot, 1, -1, 0, NULL, NULL}, {NULL, "suspend", 0, bin_suspend, 0, 0, 0, "f", NULL}, {NULL, "test", 0, bin_test, 0, -1, BIN_TEST, NULL, NULL}, ! {NULL, "ttyctl", 0, bin_ttyctl, 0, 0, 0, "fuM", NULL}, {NULL, "times", 0, bin_times, 0, 0, 0, NULL, NULL}, {NULL, "trap", 0, bin_trap, 0, -1, 0, NULL, NULL}, {NULL, "true", 0, bin_true, 0, -1, 0, NULL, NULL}, *** 1.2 1996/01/07 02:09:24 --- Doc/zshbuiltins.man 1996/01/08 06:17:20 *************** *** 852,866 **** \fBtrue\fP Do nothing and return an exit code of 0. .TP ! \fBttyctl\fP \-\fBfu\fP The \-\fBf\fP option freezes the tty, and \-\fBu\fP unfreezes it. When the tty is frozen, no changes made to the tty settings by external programs will be honored by the shell, except for changes in the size of the screen; the shell will simply reset the settings to their previous values as soon as each ! command exits or is suspended. Thus, \fBstty\fP and similar programs have ! no effect when the tty is frozen. Without options it reports whether the ! terminal is frozen or not. .TP \fBtype\fP Same as \fBwhence\fP \-\fBv\fP. --- 852,867 ---- \fBtrue\fP Do nothing and return an exit code of 0. .TP ! \fBttyctl\fP \-\fBfuM\fP The \-\fBf\fP option freezes the tty, and \-\fBu\fP unfreezes it. When the tty is frozen, no changes made to the tty settings by external programs will be honored by the shell, except for changes in the size of the screen; the shell will simply reset the settings to their previous values as soon as each ! command exits or is suspended. Thus, \fIstty\fR(1) and similar programs have ! no effect when the tty is frozen. Without options it reports whether the ! terminal is frozen or not; with the \-\fBM\fP option alone it reports this ! in the form of a \fBttyctl\fP command. .TP \fBtype\fP Same as \fBwhence\fP \-\fBv\fP. -----BEGIN PGP SIGNATURE----- Version: 2.6.i iQCVAgUBMPC4FXD/+HJTpU/hAQEBngQApoVL19C6s2HZ80WWzxSNuEUwQH/bLH6p R3VZh3dsmw65fieZ4pPPg0HpK7ZQ3plfOFnVjLtv3nLo/XmQu8wnGVW2zbrZLkUB OQk1cryj1+7OllRW/KjA2eNVNx1Xuz/LhFl/j9MvGSfmKWZJfPVI0odpdlj7sEMj Ky4GJngpfQM= =bEzj -----END PGP SIGNATURE-----