Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Regression: 'read -s' does not disable echo



> On 02/01/2024 15:25 GMT Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
> 
>  
> Folks, there's a regression on git mainline such that `read -s` does not
> suppress terminal echo.

That's not very friendly.  I guess it's to do with the way
readfd is handled.  Something like this, or more general?
Simpler is probably better here.

pws

diff --git a/Src/builtin.c b/Src/builtin.c
index 9e08a1dbc..dc651f687 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -6506,7 +6506,8 @@ bin_read(char *name, char **args, Options ops, UNUSED(int func))
     } else
 	readfd = izle = 0;
 
-    if (OPT_ISSET(ops,'s') && SHTTY == readfd) {
+    if (OPT_ISSET(ops,'s') &&
+	(SHTTY == readfd || (readfd == 0 && isatty(0)))) {
 	struct ttyinfo ti;
 	memset(&ti, 0, sizeof(struct ttyinfo));
 	gettyinfo(&ti);




Messages sorted by: Reverse Date, Date, Thread, Author