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

Questions about zpty module.



- does zsh reads pty output line by line? Or does it just reads what happens
to be in buffer? How is it related to blocking/non-blocking modes?

- manual says:

     The -r option can be used to read the output of the command NAME.
     Without a PARAM argument, the string read will be printed to
     standard output. With a PARAM argument, the string read will be
     put in the parameter named PARAM. If the PATTERN is also given,
     output will be read until the whole string read matches the
     PATTERN.

what is exactly mentioned "string" that is matched against PATTERN? Is it
the whole input? That is, in case

zpty -r command var '*\n'

will zsh wait until it reads the whole line? What happens in case of
non-blocking read then? In this case read can return with only part of
input.

- is it possible to know, if write was successful (or how many characters
were actually written)? In case of non-blocking fd and full pipe write() can
return with only partial buffer (or none at all) written

- what about read/write with timeout? It can avoid problems with
non-blocking mode while providing safe way to detect external program
failure.

/andrej



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