]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Don't output negative numbers in the ESC[13t report.
authorSimon Tatham <anakin@pobox.com>
Sat, 7 Mar 2015 20:57:26 +0000 (20:57 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 20 Jun 2015 08:31:54 +0000 (09:31 +0100)
A minus sign is illegal at that position in a control sequence, so if
ESC[13t should report something like ESC[3;-123;234t then we won't
accept it as input. Switch to printing the numbers as unsigned, so
that negative window coordinates are output as their 32-bit two's
complement; experimentation suggests that PuTTY does accept that on
input.

(cherry picked from commit 2422b18a0f4d758f0660503b068dd19d92de4906)

terminal.c

index ac8f5dff420489f1110f4887f3f13587ae0b5e41..d8d0ea0c38e8cfe2d8aa737487f4095a4bfa9c34 100644 (file)
@@ -3995,7 +3995,9 @@ static void term_out(Terminal *term)
                              case 13:
                                if (term->ldisc) {
                                    get_window_pos(term->frontend, &x, &y);
-                                   len = sprintf(buf, "\033[3;%d;%dt", x, y);
+                                   len = sprintf(buf, "\033[3;%u;%ut",
+                                                  (unsigned)x,
+                                                  (unsigned)y);
                                    ldisc_send(term->ldisc, buf, len, 0);
                                }
                                break;