aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/trilead/ssh2/channel/ChannelManager.java
diff options
context:
space:
mode:
authorJeffrey Sharkey <jsharkey@jsharkey.org>2008-08-27 10:47:56 +0000
committerJeffrey Sharkey <jsharkey@jsharkey.org>2008-08-27 10:47:56 +0000
commitcbf1af86640c76facfc140b5dfb83f2393c02d19 (patch)
tree0af4a26136f833765cc444cbfeaa52c465c83c81 /src/com/trilead/ssh2/channel/ChannelManager.java
parentba0d4f5a28170e52956705fe75a6763ce79e6264 (diff)
downloadconnectbot-cbf1af86640c76facfc140b5dfb83f2393c02d19.tar.gz
connectbot-cbf1af86640c76facfc140b5dfb83f2393c02d19.tar.bz2
connectbot-cbf1af86640c76facfc140b5dfb83f2393c02d19.zip
* moved all terminal logic into a Service backend. connections are held in place by a TerminalBridge, which keeps the connection alive and renders the screen to a
bitmap if provided. a Console creates TerminalViews for each bridge while it is active, and handles panning back/forth between them. * volume up/down controls will change console font size * extended trilead library to support resizePTY() command * left/right screen gestures will pan between various open consoles * up/down screen gestures on right-half will look through scrollback buffer * up/down screen gestures on left-half will trigger pageup/down keys * broke ctrl+ keyboard mapping, will need to bring back over from older code
Diffstat (limited to 'src/com/trilead/ssh2/channel/ChannelManager.java')
-rw-r--r--src/com/trilead/ssh2/channel/ChannelManager.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/com/trilead/ssh2/channel/ChannelManager.java b/src/com/trilead/ssh2/channel/ChannelManager.java
index ebd7585..74906d3 100644
--- a/src/com/trilead/ssh2/channel/ChannelManager.java
+++ b/src/com/trilead/ssh2/channel/ChannelManager.java
@@ -17,6 +17,7 @@ import com.trilead.ssh2.packets.PacketOpenDirectTCPIPChannel;
import com.trilead.ssh2.packets.PacketOpenSessionChannel;
import com.trilead.ssh2.packets.PacketSessionExecCommand;
import com.trilead.ssh2.packets.PacketSessionPtyRequest;
+import com.trilead.ssh2.packets.PacketSessionPtyResize;
import com.trilead.ssh2.packets.PacketSessionStartShell;
import com.trilead.ssh2.packets.PacketSessionSubsystemRequest;
import com.trilead.ssh2.packets.PacketSessionX11Request;
@@ -675,6 +676,35 @@ public class ChannelManager implements MessageHandler
throw (IOException) new IOException("PTY request failed").initCause(e);
}
}
+
+
+ public void resizePTY(Channel c, int width, int height) throws IOException {
+ PacketSessionPtyResize spr;
+
+ synchronized (c) {
+ if (c.state != Channel.STATE_OPEN)
+ throw new IOException("Cannot request PTY on this channel ("
+ + c.getReasonClosed() + ")");
+
+ spr = new PacketSessionPtyResize(c.remoteID, true, width, height);
+ c.successCounter = c.failedCounter = 0;
+ }
+
+ synchronized (c.channelSendLock) {
+ if (c.closeMessageSent)
+ throw new IOException("Cannot request PTY on this channel ("
+ + c.getReasonClosed() + ")");
+ tm.sendMessage(spr.getPayload());
+ }
+
+ try {
+ waitForChannelSuccessOrFailure(c);
+ } catch (IOException e) {
+ throw (IOException) new IOException("PTY request failed")
+ .initCause(e);
+ }
+ }
+
public void requestX11(Channel c, boolean singleConnection, String x11AuthenticationProtocol,
String x11AuthenticationCookie, int x11ScreenNumber) throws IOException