screen-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[screen-devel] row/column report escape sequence (and patch)


From: David Simmons
Subject: [screen-devel] row/column report escape sequence (and patch)
Date: Thu, 26 Jun 2008 22:57:09 -0600
User-agent: Thunderbird 2.0.0.14 (X11/20080505)


I've noticed that screen doesn't implement a potentially useful escape sequence that allows the client to query the window size. (At least not in 4.0.2, which is the latest release version on the ftp site.) I'm not sure how standard this sequence is, but it's implemented by xterm, dtterm, gnome terminal, and probably others.

I added support to my local copy by adding a few lines to ansi.c. In case anyone is interested, I've attached the patch.

One reference I've found for this "CSI 18 ; t" sequence is here:
http://rtfm.etla.org/xterm/ctlseq.html#CSI%20Ps%20;%20Ps%20;%20Ps%20t

David

diff -Nru screen-4.0.2.orig/ansi.c screen-4.0.2/ansi.c
--- screen-4.0.2.orig/ansi.c    2003-12-05 06:57:05.000000000 -0700
+++ screen-4.0.2/ansi.c 2008-06-26 22:25:26.000000000 -0600
@@ -1225,6 +1225,11 @@
          SaveCursor();
          break;
        case 't':
+          if (a1 == 18) {
+            /* report the window size */
+            Report("\033[8;%d;%dt", curr->w_height, curr->w_width);
+            break;
+          }
          if (a1 != 8)
            break;
          a1 = curr->w_args[2];

reply via email to

[Prev in Thread] Current Thread [Next in Thread]