Subject: | IO::Async::Process - loss of buffered STDOUT/STDERR when previously redirected |
When using IO::Async::Process with a code program, after STDOUT or STDERR has been redirected to /dev/null, it seems the on_read callback configured for stdout or stderr does not get called unless STDOUT or STDERR is subsequently autoflushed or enough data is sent, even when the stream closes.
Test program:
https://perl.bot/raw/qo5xhx
If any of (1) the program is a command rather than code, (2) STDOUT/STDERR is not previously redirected to /dev/null, or (3) STDOUT/STDERR is autoflushed in the child code, then the program works and receives the data from the child process.