This project is read-only.

Shell Functionality

Feb 22, 2011 at 4:25 PM

So my goal is to be able to implement my own SSH terminal/console window using this class.  I'm wondering what the Shell class is for and how its used.  I can see all of the class methods and properties in the help file, but not sure how to implement it.

Feb 22, 2011 at 4:29 PM


at a time I thought I could implement the Shell functionlity, thats why I started with the Shell class.

So it has some basic functionality but obviosly needed more work.


if you like you can call my and we can discuss this option.

If you have skype you can add me, my nickname is "olegkap" there.




Mar 1, 2011 at 2:31 PM

Got busy for awhile and haven't had a chance to follow up on this.  I was able to get the output redirected to a textbox by change changing the Channel_DataReceived method in the Shell class to the this:

        private void Channel_DataReceived(object sender, Common.ChannelDataEventArgs e)
            if (this._channelOutput != null)
                UTF8Encoding utfEncoder = new UTF8Encoding();

Now I'm struggling with sending input to the shell.  If I bring up the console and type input there, it works, but I cannot for the life of me get it to take input from anything other than the console.  Any suggestions?

Mar 1, 2011 at 2:49 PM



This is how I tried to use the shell functionality in my test:

            //var input = Console.OpenStandardInput();
            var input = new MemoryStream(Encoding.ASCII.GetBytes("exit\r\n"));
            var shell = s.CreateShell(input, Console.Out, Console.Out, "xterm", 80, 24, 800, 600, "");
            shell.Stopped += delegate(object sender, EventArgs e)
            Thread.Sleep(1000 * 1000);

Now, what I thought of doing is add some kind of functionality which will send and received data from the shell.

In the example above I am using MemorySteam or Console Stream, so I think the same way we can use any other Steam,

So may be to create some new class ShellSteam which will handle traffic to and from shell correctly and will provide some events such data received and/or data sent.

Or, may be to add this functionality to Shell class directly. Just couple ideas.