Open hacker1024 opened 6 years ago
After some testing I've realized what's actually happening; it isn't only the last line being printed, it's standard error. So, the real issues are:
commandOutput
is only called for standard error.commandOutput
is only called after the program ends, so there's no way to get standard input while the program is running.
I've overrided
commandOutput
like this:Command.terminate()
andCommand.finish()
don't kill my command (#77), so I have to kill it with another root command.My
Command
object has a timeout of zero (maybe related to this?) No output is logged until I kill the native command, and then only the last line is logged.Everything works fine with a program that ends on its own, like
ls
.Note: If I deliberately run my native binary in a non-root shell (so it prints an error and exits) all output is printed correctly.
EDIT: I forgot to say - the last line in my native program (which is the only line printed) is the only line also printed to standard error.