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

Re: zsh-beta12 read -q



becker@xxxxxxxxxxxxxxxx wrote:
> from within a shell script, this script hangs in my xterm.
> 
>     % cat sample_script
>     read -q 'answ?Continue? [n] :'
>     echo "test done; returned $? "

I posted this patch to fix it (read -k too)... since the symptoms it
fixes are different on my machine (it messes up the terminal but
doesn't hang) I'd appreciate a confirmation that it fixes it in this
case too.

The best theory is it's related to the fact that various terminal
stuff is now delayed in interactive shells to avoid causing problems
when the shell is put into the background.

*** Src/builtin.c.ti	Tue Nov  7 09:48:32 1995
--- Src/builtin.c	Wed Nov  8 16:36:58 1995
***************
*** 4615,4620 ****
--- 4615,4622 ----
  	    fflush(stderr);
  	    return 1;
  	}
+ 	if (!isset(INTERACTIVE))
+ 	    gettyinfo(&shttyinfo);
  	/* sort out the number of characters to read */
  	if (*args && idigit(**args)) {
  	    if (!(nchars = atoi(*args)))
***************
*** 4804,4809 ****
--- 4806,4813 ----
  	    fflush(stderr);
  	    return 1;
  	}
+ 	if (!isset(INTERACTIVE))
+ 	    gettyinfo(&shttyinfo);
  
  	/* set up the buffer */
  	readbuf = (char *)zalloc(2);

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



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