Open roshh opened 7 years ago
It's funny you've got every output going in the InputStream
. I'm just facing a case where the whole output which has an exit status of 0 (so, no error), and the whole output goes to the error stream... And it is while calling a command as simple as /usr/local/bin/python2.7 --version
.
I need time to be able to rewrite an easily reproducible example, which I don't have right now.
Hi,
I am having trouble getting the stderr content of a command from
net.schmizz.sshj.connection.channel.direct.Session.Shell.getErrorStream()
: All output is written exclusively to the stdout stream retrievable vianet.schmizz.sshj.connection.channel.Channel.getInputStream()
.From what I see in the debugger stderr-content would be written to the error stream if the received SSH message is of type CHANNEL_EXTENDED_DATA, but all output is received as CHANNEL_DATA messages. I have tried different terminal types (
"vt100"
,"xterm"
and"dumb"
) and setting the PTYModesIEXTEN
andOPOST
usingallocatePTY(...)
but could not change the behaviour.Does somebody have suggestion on how to direct the stderr output into the Shells ErrorStream instead of it's InputStream?
The code I used is adapted from the RudimentaryPTY-example:
stderr.txt is empty after the execution:
while all content is saved in stdout.txt