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

Re: Zsh Not resetting stdin O_NONBLOCK on Solaris

"Greg J. Badros" wrote:
> Using zsh-3.0.0 on Solaris, if I start a program that sets non-blocking
> input on stdin (using fcntl with O_NONBLOCK), and I then exit that program
> using SIGINT (Ctrl-C), zsh doesn't seem to reset stdin back to blocking
> input for future programs that the shell runs (though zle works fine).

It's not clear to me this is a bug.  Zle now doesn't use stdin, it
sets up its own fd from the terminal, so it doesn't really care what's
happened to stdin.  A quick poll reveals that ksh resets O_NONBLOCK
(interactively anyway), sh, csh and bash don't (and sh and csh react
badly if it is set), with tcsh it seems to depend on the version (6.04
bombed badly, 6.05 reset it).  This is not specific to Solaris,
although some of the results may be.

On the other hand, if you try `read line' with O_NONBLOCK set you come
unstuck because that does use stdin.  Then again, maybe you could have
set non-blocking input deliberately, which after all gives just the
effect you would expect?  It's still not clear that it's the shell's
business to tidy this up, or if it should, under what circumstances
that should be.

Sorry, that's not very helpful.

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