Chilkat Forum

Technologies => SSH => Topic started by: spino on March 15, 2018, 10:34:19 AM

Title: CkSsh: How to get stderr from a QuickShell (remote shell PTY session).
Post by: spino on March 15, 2018, 10:34:19 AM

I wonder if it is possible to get the stderr (GetReceivedStderrText) separately from stdout (GetReceivedText)?

I'm trying to do this by:

 1. For CkSsh object, I do "ssh->put_StderrToStdout(false);"

 2. To request the shell, I do "int channel = ssh->QuickShell();"

 3. To get the output I do:

Code: [Select]
*std_out = ssh->getReceivedText(channel, "ansi");
if (!ssh->get_LastMethodSuccess()) {
    cerr << "error" << std::endl; 

*std_err = ssh->getReceivedStderrText(channel, "ansi");
if (!ssh->get_LastMethodSuccess()) {
    cerr << "error" << std::endl;

However, I just get both stdout and stderr together in getReceivedText. Please notice that a similar approach works for connections where I don't request a shell/pty (a.k.a using ssh->SendReqExec).

Thanks for the time and help.