title: SSH.NET real-time command output monitoring
body: <p>There is a long running script <code>script.sh</code> on a remote Linux machine. I need to start it and monitor it's activity in real time. The script during it's activity may output to <code>stdout</code> and <code>stderr</code>. I am searching for a way to capture both of the streams.</p>
  
  <p>I use Renci SSH.NET to upload <code>script.sh</code> and start it, so it would be great to see a solution bounded to this library. In my mind the perfect solution is the new method:</p>
  
  <pre class="lang-cs prettyprint-override"><code>var realTimeScreen= ...;
  
  var commandExecutionStatus = sshClient.RunCommandAsync(
      command: './script.sh',
      stdoutEventHandler: stdoutString =&gt; realTimeScreen.UpdateStdout(stdString)
      stderrEventHandler: stderrString =&gt; realTimeScreen.UpdateStderr(stderrString));
  ...
  commandExecutionStatus.ContinueWith(monitoringTask =&gt;
  {
      if (monitoringTask.Completed)
      {
          realTimeScreen.Finish();
      }
  });
  </code></pre>