Ideally, the command-line tool(s) that you're trying to run should be able to operate without requiring user input after issuing the command line. The process should either get all the information it needs from the user via command line args, or else it should be able to get whatever it needs from a pipe or file redirection to its stdin (or environment variables, or a known config file, or...). Either way, you should be able to launch it and then just wait for it to finish, without further ado.
If you absolutely must provide a GUI to a tool that absolute does not work that way, then I'd have to second the suggestion above about Expect and IPC::Open3. Yeah, eewwww. Either that or else fix/replace the CLI tool(s) you're using so that you don't have to write something really complicated that requires constant attention and piecemeal inputs from the GUI user. | [reply] |
| [reply] |
It would be helpful to us if you would post the specific snippet of your code (in proper code-tags) that is responsible for launching the child process and gathering the STDOUT/STDERR streams from it. Superficially, that ought to be simple ... just intercept STDIN as well ... but things in Tk are not always so simple. So, let us see just how you are now launching the child. And, confirm how you are recognizing that it has produced an output that is a prompt.
| |