[vte] emulation: Fix background color handling of DCH and ECH



commit 92c05284388a569f9b423bc839fca8868d2156af
Author: Egmont Koblinger <egmont gmail com>
Date:   Sat Jun 29 23:42:39 2019 +0200

    emulation: Fix background color handling of DCH and ECH
    
    https://gitlab.gnome.org/GNOME/vte/issues/136

 src/vte.cc    | 3 +--
 src/vteseq.cc | 9 ++++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 7c2ef159..6ed8fccd 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -2943,14 +2943,13 @@ Terminal::insert_char(gunichar c,
        if (insert) {
                 cleanup_fragments(col, col);
                for (i = 0; i < columns; i++)
-                        _vte_row_data_insert (row, col + i, &m_color_defaults);
+                        _vte_row_data_insert (row, col + i, &basic_cell);
        } else {
                 cleanup_fragments(col, col + columns);
                _vte_row_data_fill (row, &basic_cell, col + columns);
        }
 
         attr = m_defaults.attr;
-        attr.copy_colors(m_color_defaults.attr);
        attr.set_columns(columns);
 
        {
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 15358aca..894b95fe 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -891,12 +891,18 @@ Terminal::delete_character()
                g_assert(rowdata != NULL);
                 col = m_screen->cursor.col;
                len = _vte_row_data_length (rowdata);
+
+                bool const not_default_bg = (m_color_defaults.attr.back() != VTE_DEFAULT_BG);
+                if (not_default_bg) {
+                        _vte_row_data_fill(rowdata, &basic_cell, m_column_count);
+                        len = m_column_count;
+                }
+
                /* Remove the column. */
                if (col < len) {
                         /* Clean up Tab/CJK fragments. */
                         cleanup_fragments(col, col + 1);
                        _vte_row_data_remove (rowdata, col);
-                        bool const not_default_bg = (m_color_defaults.attr.back() != VTE_DEFAULT_BG);
 
                         if (not_default_bg) {
                                 _vte_row_data_fill(rowdata, &m_color_defaults, m_column_count);
@@ -947,6 +953,7 @@ Terminal::erase_characters(long count)
                 cleanup_fragments(m_screen->cursor.col, m_screen->cursor.col + count);
                /* Write over the characters.  (If there aren't enough, we'll
                 * need to create them.) */
+                _vte_row_data_fill (rowdata, &basic_cell, m_screen->cursor.col);
                for (i = 0; i < count; i++) {
                         col = m_screen->cursor.col + i;
                        if (col >= 0) {


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