1 2 29 30 package com.jcraft.jsch; 31 32 class RequestPtyReq extends Request{ 33 private String ttype="vt100"; 34 private int tcol=80; 35 private int trow=24; 36 private int twp=640; 37 private int thp=480; 38 39 private byte[] terminal_mode="".getBytes(); 40 41 void setCode(String cookie){ 42 } 43 44 void setTType(String ttype){ 45 this.ttype=ttype; 46 } 47 48 void setTerminalMode(byte[] termianl_mode){ 49 this.terminal_mode=terminal_mode; 50 } 51 52 void setTSize(int tcol, int trow, int twp, int thp){ 53 this.tcol=tcol; 54 this.trow=trow; 55 this.twp=twp; 56 this.thp=thp; 57 } 58 59 public void request(Session session, Channel channel) throws Exception { 60 super.request(session, channel); 61 62 Buffer buf=new Buffer(); 63 Packet packet=new Packet(buf); 64 65 packet.reset(); 66 buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); 67 buf.putInt(channel.getRecipient()); 68 buf.putString("pty-req".getBytes()); 69 buf.putByte((byte)(waitForReply() ? 1 : 0)); 70 buf.putString(ttype.getBytes()); 71 buf.putInt(tcol); 72 buf.putInt(trow); 73 buf.putInt(twp); 74 buf.putInt(thp); 75 buf.putString(terminal_mode); 76 write(packet); 77 } 78 } 79 | Popular Tags |