SSH.NET Shell display output at the last line

Feb 6, 2014 at 2:55 PM
say you issue the following command:

apt-get install MySql

this command generates an output where some of the text is displayed line by line and some should be displayed at the last line. Here is an example :

Reading package lists... 0%

Reading package lists... 100%

Reading package lists... Done

Building dependency tree... 0%

Building dependency tree... 0%

Building dependency tree... 50%

Building dependency tree... 50%

Building dependency tree

Reading state information... 0%

Reading state information... 1%

Reading state information... Done

These lines should be overwritten. How to handle this output stream to emulate what remote shell does.
I am using ShellStream functionality

Thank you.
Feb 6, 2014 at 3:00 PM
Implement a Terminal, which is not simple.
You have to parse and handle control chars.

So far I haven't found a good terminal emulator in C#.
And hacking it on your own is huge task and must be worth the effort.
Feb 6, 2014 at 3:33 PM
thank you for a quick reply.
Indeed, a challenging task. On top of it, I want to emulate it in Silverlight.

Thanks again for the references.
Feb 6, 2014 at 3:46 PM
with that being said.
I am new to SSH.NET and still learning.

What would be the best point to start?

the following code

     static void ycmd(string cmd, StreamReader reader, StreamWriter writer, ShellStream stream) {

        while (stream.Length == 0) {

        string line = reader.ReadLine();
        while (line != null) {
            line = reader.ReadLine();

where streams are defined as follows

  using (var stream = ssh.CreateShellStream("dumb", 80, 24, 800, 600, 1024)) {
                var reader = new StreamReader(stream);
                var writer = new StreamWriter(stream);

already, provides all the formatting of the input/output sequences .
So, the question is what needs to changed to format this output?

Thank you.