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

Re: zpty

Oliver Kiddle wrote:
> Anyway, try running this:
>   zpty test cat
>   zpty -L
>   ^C
> Why does zpty -L need to call checkptycmd()? Is that to see if the
> process is still alive? It tries to read one character which blocks.

Yes, I imagine so.  This is useless.  It needs to use non-blocking I/O,
otherwise it shouldn't even bother with the test --- hanging up is not
acceptable, even if the information returned is a little out of date.
So I think removing checkptycmd() for now ought to be an improvement
(haven't actually tried).

read_poll() would be an improvement, but care is needed --- the device
is a terminal and while there is some handling for that (i) it was
tricky and I nearly blew a gasket getting it to work on the systems I
tried, so we may be back in system-specific land (ii) currently it
assumes the terminal in use is the shell terminal, which isn't the case
here.  (In particulay, using select() and poll() on terminals didn't
always seemed to work, I had to use termios.)

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


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