Update:
I was using kill() to kill the application; terminate() does nothing.
When the application stops and waits for user input I can use write() to send input, and that does work.
What does not work is when I send input while the application is working.
Bookmarks