Quote:
Originally Posted by
howdini
The only time I received an isatty related error was with a few interactive types of programs like top. It said that the tty check failed, just as you said some of them would. passwd on the other hand launches well and requests for some input.
If stdin isn't a terminal, it will open
/dev/tty directly and talk to the terminal through that. This bypasses your pipes completely.
Quote:
getting it this input and retrieving the next output is proving to be the challenge. I hope you are not saying that this method completely cannot work with interactive programs.
I am; I tried to warn you about this from the beginning.
Not that this has been a waste of your time. There
is a way to do this, closely related to what you've been doing -- instead of creating and duplicating pipes over things, create and duplicate a virtual terminal. It acts
sort of like a pipe, with some important differences -- it's bidirectional, for one thing. And ctrl-c characters will cause the kernel to send SIGINT, etc, like you'd expect to happen in a terminal.
here's an example I wrote back when I was playing with vterms and linked early in this thread. It'll be trickier than using pipes but related so it's a good thing to have gotten pipes working first.