Sidney Markowitz <sidney@...> writes:
> I've found a solution for the problem with tests/run-program.impure.lisp under
> Mac OS that also simplifies the test, removing the two things that are marked
> as kludges in the comments.
> What is going on is that by default Mac OS sets up stdin and stdout as not
> buffered if a process is talking to a tty, otherwise they are buffered. The
> :BUFFER NIL in the fd-streams that are created in run-program.impure.lisp has
> no effect, as the problem is that the child process' stdin is what is
> buffered, so nothing ends up coming out on stdout until the process exits.
> The fix is to use the :PTY t argument to run-program instead of :INPUT and
> :OUTPUT, which causes the child process to be created with a pseudo-tty for
> stdin and stdout, then get the created stream using the process-pty accessor.
> It does not seem to work to create a stream to pass as the :PTY argument, you
> have to use the generated one.
> A nice side effect of doing this is that the mysterious buffer problems that
> are kludged around in the test code by adding a sleep and using
> read-char-no-hang, all go away.
Thank you. Something like this was (finally!) merged as 18.104.22.168.
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."