jackpal/Android-Terminal-Emulator — pull request #258 by dstahlke (2013-07-22 01:24:21+00:00)
Title: clip mouse to limits of 8-bit data

When sending mouse events as terminal codes, avoid overflow due to the limitations of 8-bit data. I chose to just not send events when out-of-bounds (even for scroll), which is what konsole does. xterm chooses to send 0 for the coordinate in this case. I don't know whether there is a reason that konsole doesn't do it that way... Also, konsole maxes out at column 222 rather than 223 (corresponding to sending 0xfe). I don't know why, perhaps that's a bug. Xterm and gnome-terminal will send 0xff for column 223, and I do it this way.

There are competing proposals for how to handle rows/columns greater than 223. Konsole doesn't implement either of these, so I assume they are not currently in demand. If someone needs columns >223 I can implement this.