[vte] debug: Improve sequence->string conversion



commit bef7a550a9be7889735a4333f2820792e72e9853
Author: Christian Persch <chpe gnome org>
Date:   Thu May 22 20:10:19 2014 +0200

    debug: Improve sequence->string conversion
    
    Print OSC, CSI etc.

 src/debug.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/debug.c b/src/debug.c
index 257ef30..af2a763 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -86,7 +86,18 @@ _vte_debug_sequence_to_string(const char *str)
                 if (i > 0)
                         g_string_append_c(buf, ' ');
 
-                if (c <= 0x20)
+                if (c == '\033' /* ESC */) {
+                        switch (str[++i]) {
+                        case '_': g_string_append(buf, "APC"); break;
+                        case '[': g_string_append(buf, "CSI"); break;
+                        case 'P': g_string_append(buf, "DCS"); break;
+                        case ']': g_string_append(buf, "OSC"); break;
+                        case '^': g_string_append(buf, "PM"); break;
+                        case '\\': g_string_append(buf, "ST"); break;
+                        default: g_string_append(buf, "ESC"); i--; break;
+                        }
+                }
+                else if (c <= 0x20)
                         g_string_append(buf, codes[c]);
                 else if (c == 0x7f)
                         g_string_append(buf, "DEL");


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