Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
-M option for ttyctl
- X-seq: zsh-workers 719
- From: Zefram <A.Main@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx (Z Shell workers mailing list)
- Subject: -M option for ttyctl
- Date: Mon, 8 Jan 1996 06:23:17 +0000 (GMT)
-----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-----
Messages sorted by:
Reverse Date,
Date,
Thread,
Author