00001 using System;
00002 using Tamir.SharpSsh.java.lang;
00003
00004 namespace Tamir.SharpSsh.jsch
00005 {
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 public class ChannelShell : ChannelSession
00036 {
00037 internal bool xforwading=false;
00038 internal bool pty=true;
00039 public override void setXForwarding(bool foo){ xforwading=foo; }
00040 public void setPty(bool foo){ pty=foo; }
00041 public override void start()
00042 {
00043 try
00044 {
00045 Request request;
00046 if(xforwading)
00047 {
00048 request=new RequestX11();
00049 request.request(session, this);
00050 }
00051 if(pty)
00052 {
00053 request=new RequestPtyReq();
00054 request.request(session, this);
00055 }
00056 request=new RequestShell();
00057 request.request(session, this);
00058 }
00059 catch
00060 {
00061 throw new JSchException("ChannelShell");
00062 }
00063 thread=new Thread(this);
00064 thread.setName("Shell for "+session.host);
00065 thread.start();
00066 }
00067 public override void init()
00068 {
00069 io.setInputStream(session.In);
00070 io.setOutputStream(session.Out);
00071 }
00072
00073 public void setPtySize(int col, int row, int wp, int hp)
00074 {
00075
00076 try
00077 {
00078 RequestWindowChange request=new RequestWindowChange();
00079 request.setSize(col, row, wp, hp);
00080 request.request(session, this);
00081 }
00082 catch(Exception e)
00083 {
00084 throw new JSchException("ChannelShell.setPtySize: "+e.ToString());
00085 }
00086 }
00087 }
00088
00089 }