diff options
author | Kenny Root <kenny@the-b.org> | 2008-11-14 08:09:35 +0000 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2008-11-14 08:09:35 +0000 |
commit | 2f1d9fb2e826a2a40cfe036e22b57dfdf2b0f9e9 (patch) | |
tree | b514fbc9421e3766d3e7775714fcbf7bdd6c128d /src | |
parent | 08a38b062e02b314c9951cd983df24bb392ac0a8 (diff) | |
download | connectbot-2f1d9fb2e826a2a40cfe036e22b57dfdf2b0f9e9.tar.gz connectbot-2f1d9fb2e826a2a40cfe036e22b57dfdf2b0f9e9.tar.bz2 connectbot-2f1d9fb2e826a2a40cfe036e22b57dfdf2b0f9e9.zip |
* Fix bug where scroll regions were blown away when you exited the console activity and came back.
Diffstat (limited to 'src')
-rw-r--r-- | src/org/connectbot/service/TerminalBridge.java | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/org/connectbot/service/TerminalBridge.java b/src/org/connectbot/service/TerminalBridge.java index 3dfba29..b9dbcdf 100644 --- a/src/org/connectbot/service/TerminalBridge.java +++ b/src/org/connectbot/service/TerminalBridge.java @@ -514,7 +514,7 @@ public class TerminalBridge implements VDUDisplay, OnKeyListener, InteractiveCal // previously tried vt100 and xterm for emulation modes // "screen" works the best for color and escape codes // TODO: pull this value from the preferences - this.session.requestPTY(emulation, 0, 0, 0, 0, null); + this.session.requestPTY(emulation, termWidth, termHeight, 0, 0, null); this.session.startShell(); // grab stdin/out from newly formed session @@ -793,20 +793,24 @@ public class TerminalBridge implements VDUDisplay, OnKeyListener, InteractiveCal * terminal size information and request a PTY resize. */ public synchronized void parentChanged(TerminalView parent) { - this.parent = parent; int width = parent.getWidth(); int height = parent.getHeight(); - // recalculate buffer size - int termWidth, termHeight; - - if (this.forcedSize) { - termWidth = this.termWidth; - termHeight = this.termHeight; - } else { - termWidth = width / charWidth; - termHeight = height / charHeight; + if (!this.forcedSize) { + // recalculate buffer size + int newTermWidth, newTermHeight; + + newTermWidth = width / charWidth; + newTermHeight = height / charHeight; + + // If nothing has changed in the terminal dimensions and not an intial + // draw then don't blow away scroll regions and such. + if (newTermWidth == termWidth && newTermHeight == termHeight) + return; + + termWidth = newTermWidth; + termHeight = newTermHeight; } // reallocate new bitmap if needed |