Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: read -s doesn't work with -t?
- X-seq: zsh-users 12589
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: "zsh users" <zsh-users@xxxxxxxxxx>
- Subject: Re: read -s doesn't work with -t?
- Date: Sat, 16 Feb 2008 08:50:45 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=zR+U/N51EXc5FaJXupGacMV6sUn/WUwmLHH8/M5ZiQk=; b=M5M+zmu1Ujj/5N7lv1yj+GPDPP6XH5t4facmz6iIf/W6m6vbxgnO6YlFtH30C5Hy7Kp4U6QAYWEkY84XEvqlRGpvH5x9zflVQ5vuUfm8L5LKfE9Qih8+z3E4Zs+oh/lpA09LRNwhxVE+wBWzY23hFTzgic6MNHlHlwK6kOiCDek=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NUkbT8y53wZWu6kXDD4u0s0Acg36+1skXTwTOUqI/9sGI1L1Oh0mr/aw6PQfOb3rYL6TFTmjkzcRIH46pwlrPUqYCwh0HEAK+BvkqMQRqLYgVhC/ILy+bgpSzYbaECIx8m+3Nx3cpXwnV9b/99osNDrUVaPvzEmFrD9C0niv8Mw=
- In-reply-to: <237967ef0802152333g7f759674r806f61f9f76f86f2@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0802151327q1c6d3a19oa67a977b82c52f67@xxxxxxxxxxxxxx> <080215191216.ZM29994@xxxxxxxxxxxxxxxxxxxxxx> <237967ef0802152333g7f759674r806f61f9f76f86f2@xxxxxxxxxxxxxx>
On 16/02/2008, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On 16/02/2008, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > On Feb 15, 10:27pm, Mikael Magnusson wrote:
> > } Subject: read -s doesn't work with -t?
> >
> > }
> > } However, when I
> > } give read -s -t 60, the -s seems to be ignored. Bug or feature?
> >
> >
> > This sounds like it may be related to:
> >
> > http://www.zsh.org/mla/workers/2008/msg00071.html
> >
> > That thread just sort of died without resolution because PWS can't
> > reproduce the problem.
>
>
> Hmm, weird. For me it happens on both 4.2.5 and 4.3.4/5, and I've
> tried sshing to all machines I have access to with zsh, and it is the
> same on all of them. Even found a 4.2.3-dev1 now that's the same...
Maybe this is overly naive, but the following seems to fix the issue
for me. That is, just moving the code for -s up above the code for -t.
I tried combinations of -t, -s and -k, and they all worked as I
expected after the change.
diff --git a/Src/builtin.c b/Src/builtin.c
index 289e5f3..a2b47da 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -4822,6 +4822,21 @@ bin_read(char *name, char **args, Options ops,
UNUSED(int func))
} else
readfd = izle = 0;
+ if (OPT_ISSET(ops,'s') && SHTTY != -1) {
+ struct ttyinfo ti;
+ gettyinfo(&ti);
+ if (! resettty) {
+ saveti = ti;
+ resettty = 1;
+ }
+#ifdef HAS_TIO
+ ti.tio.c_lflag &= ~ECHO;
+#else
+ ti.sgttyb.sg_flags &= ~ECHO;
+#endif
+ settyinfo(&ti);
+ }
+
if (OPT_ISSET(ops,'t')) {
zlong timeout = 0;
if (OPT_HASARG(ops,'t')) {
@@ -4882,20 +4897,6 @@ bin_read(char *name, char **args, Options ops,
UNUSED(int func))
settyinfo(&ti);
}
}
- if (OPT_ISSET(ops,'s') && SHTTY != -1) {
- struct ttyinfo ti;
- gettyinfo(&ti);
- if (! resettty) {
- saveti = ti;
- resettty = 1;
- }
-#ifdef HAS_TIO
- ti.tio.c_lflag &= ~ECHO;
-#else
- ti.sgttyb.sg_flags &= ~ECHO;
-#endif
- settyinfo(&ti);
- }
/* handle prompt */
if (firstarg) {
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author