[vte/vte-0-36] emulation: Add support for OSC 112 (reset cursor color)



commit b7c7417127521fbf6639ba78d5d32f1fe27a28c9
Author: Kevin Goodsell <kevingoodsell lists gmail com>
Date:   Tue Jan 21 00:39:38 2014 +0100

    emulation: Add support for OSC 112 (reset cursor color)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=640040

 src/caps.c         |    2 ++
 src/osc            |    1 +
 src/vteseq-n.gperf |    1 +
 src/vteseq.c       |    7 +++++++
 4 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/caps.c b/src/caps.c
index 5843c9d..a35c52d 100644
--- a/src/caps.c
+++ b/src/caps.c
@@ -537,6 +537,7 @@ struct _vte_capability_string _vte_xterm_capability_strings[] = {
        {OSC "46;%s" BEL, "change-logfile", 0},
        {OSC "50;#%d" BEL, "change-font-number", 0},
        {OSC "50;%s" BEL, "change-font-name", 0},
+       {OSC "112" BEL, "reset-cursor-colors", 0},
 
        /* Set text parameters, ST-terminated versions. */
        {OSC ";%s" ST, "set-icon-and-window-title", 0}, /* undocumented default */
@@ -558,6 +559,7 @@ struct _vte_capability_string _vte_xterm_capability_strings[] = {
        {OSC "46;%s" ST, "change-logfile", 0},
        {OSC "50;#%d" ST, "change-font-number", 0},
        {OSC "50;%s" ST, "change-font-name", 0},
+       {OSC "112" ST, "reset-cursor-colors", 0},
 
        /* These may be bogus, I can't find docs for them anywhere (#104154). */
        {OSC "21;%s" BEL, "set-text-property-21", 0},
diff --git a/src/osc b/src/osc
index 34dc9ea..50cd7f4 100755
--- a/src/osc
+++ b/src/osc
@@ -11,6 +11,7 @@ if [ "$#" -eq 0 ] ; then
        echo "  6 'uri'         change current file uri"
        echo "  7 'uri'         change current directory uri"
        echo "  12 'color'      change cursor color"
+       echo "  112             reset cursor color"
        exit
 fi
 args=
diff --git a/src/vteseq-n.gperf b/src/vteseq-n.gperf
index 197183e..4ba53ed 100644
--- a/src/vteseq-n.gperf
+++ b/src/vteseq-n.gperf
@@ -78,6 +78,7 @@ struct vteseq_n_struct {
 "utf-8-character-set", VTE_SEQUENCE_HANDLER(vte_sequence_handler_utf_8_charset)
 "window-manipulation", VTE_SEQUENCE_HANDLER(vte_sequence_handler_window_manipulation)
 "change-cursor-colors", VTE_SEQUENCE_HANDLER(vte_sequence_handler_change_cursor_color)
+"reset-cursor-colors", VTE_SEQUENCE_HANDLER(vte_sequence_handler_reset_cursor_color)
 "character-attributes", VTE_SEQUENCE_HANDLER(vte_sequence_handler_character_attributes)
 "device-status-report", VTE_SEQUENCE_HANDLER(vte_sequence_handler_device_status_report)
 "set-scrolling-region", VTE_SEQUENCE_HANDLER(vte_sequence_handler_set_scrolling_region)
diff --git a/src/vteseq.c b/src/vteseq.c
index 4f385a6..2dd9daa 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -3540,6 +3540,13 @@ vte_sequence_handler_change_cursor_color (VteTerminal *terminal, GValueArray *pa
        }
 }
 
+/* Reset the color of the cursor */
+static void
+vte_sequence_handler_reset_cursor_color (VteTerminal *terminal, GValueArray *params)
+{
+       _vte_terminal_set_color_internal(terminal, VTE_CUR_BG, VTE_COLOR_SOURCE_ESCAPE, NULL);
+}
+
 
 /* Lookup tables */
 


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