[hackers] [st] ECH handled correctly. || Aur?lien Aptel

From: <hg_AT_suckless.org>
Date: Sun, 21 Feb 2010 13:15:35 +0000 (UTC)

changeset: 72:677fcf8e69b2
tag: tip
user: Aur?lien Aptel <aurelien.aptel_AT_gmail.com>
date: Sun Feb 21 14:14:58 2010 +0100
files: st.c
description:
ECH handled correctly.

diff -r e509aae4615d -r 677fcf8e69b2 st.c
--- a/st.c Mon Feb 08 23:16:55 2010 +0100
+++ b/st.c Sun Feb 21 14:14:58 2010 +0100
@@ -692,13 +692,24 @@
                         default:
                                 goto unknown;
                         }
- } else goto unknown;
+ } else {
+ switch(escseq.arg[0]) {
+ case 4:
+ term.mode &= ~MODE_INSERT;
+ break;
+ default:
+ goto unknown;
+ }
+ }
                 break;
         case 'M': /* DL -- Delete <n> lines */
                 DEFAULT(escseq.arg[0], 1);
                 tdeleteline(escseq.arg[0]);
                 break;
- case 'X': /* ECH -- Erase <n> char XXX: same? */
+ case 'X': /* ECH -- Erase <n> char */
+ DEFAULT(escseq.arg[0], 1);
+ tclearregion(term.c.x, term.c.y, term.c.x + escseq.arg[0], term.c.y);
+ break;
         case 'P': /* DCH -- Delete <n> char */
                 DEFAULT(escseq.arg[0], 1);
                 tdeletechar(escseq.arg[0]);
@@ -727,10 +738,16 @@
                                 tcursor(CURSOR_SAVE);
                                 tclearregion(0, 0, term.col-1, term.row-1);
                                 break;
- default:
- goto unknown;
+ default: goto unknown;
                         }
- } else goto unknown;
+ } else {
+ switch(escseq.arg[0]) {
+ case 4:
+ term.mode |= MODE_INSERT;
+ break;
+ default: goto unknown;
+ }
+ };
                 break;
         case 'm': /* SGR -- Terminal attribute (color) */
                 tsetattr(escseq.arg, escseq.narg);
Received on Sun Feb 21 2010 - 13:15:35 UTC

This archive was generated by hypermail 2.2.0 : Sun Feb 21 2010 - 13:24:07 UTC