terminology: Check for 7-bit ST (ESC \)
authorenglebass <englebass@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 4 Oct 2012 23:18:54 +0000 (23:18 +0000)
committerenglebass <englebass@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 4 Oct 2012 23:18:54 +0000 (23:18 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/terminology@77484 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/termptyesc.c

index feb6ddc..a7d8185 100644 (file)
@@ -20,6 +20,7 @@
 
 #define ST 0x9c // String Terminator
 #define BEL 0x07 // Bell
+#define ESC 033 // Escape
 
 static int
 _csi_arg_get(Eina_Unicode **ptr)
@@ -873,12 +874,17 @@ _handle_esc_xterm(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
    b = buf;
    while ((cc < ce) && (*cc != ST) && (*cc != BEL))
      {
+        if ((cc < ce - 1) && (*cc == ESC) && (*(cc + 1) == '\\'))
+          {
+             cc++;
+             break;
+          }
         *b = *cc;
         b++;
         cc++;
      }
    *b = 0;
-   if ((*cc == ST) || (*cc == BEL)) cc++;
+   if ((*cc == ST) || (*cc == BEL) || (*cc == '\\')) cc++;
    else return -2;
    switch (buf[0])
      {