That worked. I tried to get it to a point where I could check that I get the expected initial output using StringIO and the into option for System.cmd. But I’m not finding the right way to do it, if it is supposed to work. So I’ll settle with a lesser solution for now. But System.cmd seems to behave well.
But an IO.stream() taking the pid from StringIO as the device seems like it should work from my reading. I might be doing it wrong. Should experiment more but need to restrain myself from yak shaving since it is client work.