Mercurial > 510Connectbot
diff src/com/five_ten_sg/connectbot/service/TerminalMonitor.java @ 308:42b15aaa7ac7 ganymed
merge
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 30 Jul 2014 14:21:50 -0700 |
parents | 071eccdff8ea |
children | 2f2b5a244a4d |
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java Wed Jul 30 13:38:04 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java Wed Jul 30 14:21:50 2014 -0700 @@ -378,6 +378,7 @@ public synchronized void cursorMove(int l, int c) { if ((to_line != l) || (to_column != c)) moved = true; + to_line = l; to_column = c; } @@ -421,21 +422,23 @@ int len = data.length - offset; char[] da = new char[len]; System.arraycopy(data, offset, da, 0, len); + if ((l > 60000) || (c > 60000)) { l = -1; c = -1; } else { // ignore setfield outside screen boundaries - if ((l >= buffer.height) || (c+len >= buffer.width)) return; + if ((l >= buffer.height) || (c + len >= buffer.width)) return; } + buffer.setField(l, c, da); } public synchronized void showUrl(char [] data, int offset) { Log.i(TAG, "setField()"); char[] da = new char[data.length - offset]; - System.arraycopy(data, offset, da, 0, data.length-offset); + System.arraycopy(data, offset, da, 0, data.length - offset); String url = new String(da); Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); parent.startActivity(intent); @@ -447,12 +450,14 @@ arg2[2] = (char)(l & 0x0000ffff); arg2[3] = (char)(c & 0x0000ffff); int base = 4; - if ((l >= buffer.height) || (c+len >= buffer.width)) { - Arrays.fill(arg2, base, len-1, ' '); + + if ((l >= buffer.height) || (c + len >= buffer.width)) { + Arrays.fill(arg2, base, len - 1, ' '); } else { System.arraycopy(buffer.charArray[buffer.screenBase + l], c, arg2, base, len); } + monitorWrite(MONITOR_CMD_FIELDVALUE, arg2); } @@ -467,6 +472,7 @@ public synchronized void depress(int vk_key) { Log.i(TAG, String.format("depress() %d", vk_key)); Integer x = keymap.get(new Integer(vk_key)); + if (x != null) buffer.keyDepressed(x, ' ', 0); }