Add DSR cursor position sequence
authorMihail Zenkov <mihail.zenkov@gmail.com>
Tue, 1 Oct 2013 18:01:15 +0000 (20:01 +0200)
committerRoberto E. Vargas Caballero <k0ga@shike2.com>
Wed, 2 Oct 2013 18:45:19 +0000 (20:45 +0200)
st.c

diff --git a/st.c b/st.c
index c3a04c5..05e285c 100644 (file)
--- a/st.c
+++ b/st.c
@@ -2067,6 +2067,13 @@ csihandle(void) {
        case 'm': /* SGR -- Terminal attribute (color) */
                tsetattr(csiescseq.arg, csiescseq.narg);
                break;
+       case 'n': /* DSR – Device Status Report (cursor position) */
+               if (csiescseq.arg[0] == 6) {
+                       char buf[40];
+                       int len = snprintf(buf, sizeof(buf),"\033[%i;%iR", term.c.y+1, term.c.x+1);
+                       ttywrite(buf, len);
+                       break;
+               }
        case 'r': /* DECSTBM -- Set Scrolling Region */
                if(csiescseq.priv) {
                        goto unknown;