zsh-workers
 help / color / mirror / code / Atom feed
* zsh-beta12 read -q
@ 1995-11-27 16:07 Paul H. Becker
  1995-11-27 16:56 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Paul H. Becker @ 1995-11-27 16:07 UTC (permalink / raw)
  To: zsh-workers


from within a shell script, this script hangs in my xterm.

    % cat sample_script
    read -q 'answ?Continue? [n] :'
    echo "test done; returned $? "

it is ok when typed in on the command line.
I tried using zsh-2.6-beta12 and zsh-2.6-beta10.

here is how I invoked it.

    % zsh-2.6b12 -f
    % read -q 'answ?Continue? [n] :'

(as expected.)

    % zsh-2.6b10 -f sample_script

(as expected.)

    % zsh-2.6b12 -f sample_script

(hangs)

    % uname -a
    HP-UX phobos A.09.05 A 9000/715

thanks again for all the great work on the best shell going...
------------------------------------------------------------------------------
Paul Becker              o       Atria Software       main:    617-676-2400
(617)676-2605           /~>     20 Maguire Road       fax:     617-676-2410
becker@Atria.com     o...(\     Lexington, MA  02173  http://www.atria.com/
-----------------  ~~~~~~~~~~  -----------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: zsh-beta12 read -q
  1995-11-27 16:07 zsh-beta12 read -q Paul H. Becker
@ 1995-11-27 16:56 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 1995-11-27 16:56 UTC (permalink / raw)
  To: becker; +Cc: Zsh hackers list

becker@phobos.atria.com 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@ifh.de>       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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-11-27 17:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-11-27 16:07 zsh-beta12 read -q Paul H. Becker
1995-11-27 16:56 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).