summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgmont Koblinger <egmont@gmail.com>2017-04-23 23:57:57 +0200
committerEgmont Koblinger <egmont@gmail.com>2017-05-04 11:46:02 +0200
commit992c481f21e266e7cdfcee1d425b18da4df9ef8d (patch)
tree39e6c30070cf8d3468788ef523f586c59c4881e0
parent129c4e74d9d53bff8c45401e71f075d685b8503e (diff)
downloadvte-0.48.3.tar.gz
emulation: Disregard bce only when autowrapping to the new line0.48.3
Apply bce (background color erase) on a line that newly appears due to an explicit escape sequence, but not when the text overflows to the next line. This improves the fix from commit 18171bcfeaf8f3bf4bcb8a04dfcff916a3fbc40b and fixes the le editor. https://bugzilla.gnome.org/show_bug.cgi?id=754596#c15 (cherry picked from commit a26a60b8e564968b61716f0d2e52e17cd9362413)
-rw-r--r--src/vte.cc13
-rw-r--r--src/vteinternal.hh2
-rw-r--r--src/vteseq.cc4
3 files changed, 10 insertions, 9 deletions
diff --git a/src/vte.cc b/src/vte.cc
index d8fc4fc4..c56c7da7 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -2770,7 +2770,7 @@ VteTerminalPrivate::cleanup_fragments(long start,
/* Cursor down, with scrolling. */
void
-VteTerminalPrivate::cursor_down()
+VteTerminalPrivate::cursor_down(bool explicit_sequence)
{
long start, end;
@@ -2819,13 +2819,14 @@ VteTerminalPrivate::cursor_down()
update_insert_delta();
}
- /* Match xterm and fill the new row when scrolling. */
-#if 0 /* Disable for now: see bug 754596. */
- if (m_fill_defaults.attr.back != VTE_DEFAULT_BG) {
+ /* Handle bce (background color erase), however, diverge from xterm:
+ * only fill the new row with the background color if scrolling
+ * happens due to an explicit escape sequence, not due to autowrapping.
+ * See bug 754596 for details. */
+ if (explicit_sequence && m_fill_defaults.attr.back != VTE_DEFAULT_BG) {
VteRowData *rowdata = ensure_row();
_vte_row_data_fill (rowdata, &m_fill_defaults, m_column_count);
}
-#endif
} else {
/* Otherwise, just move the cursor down. */
m_screen->cursor.row++;
@@ -2962,7 +2963,7 @@ VteTerminalPrivate::insert_char(gunichar c,
/* Mark this line as soft-wrapped. */
row = ensure_row();
row->attr.soft_wrapped = 1;
- cursor_down();
+ cursor_down(false);
} else {
/* Don't wrap, stay at the rightmost column. */
col = m_screen->cursor.col =
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index ff5b93c2..a20e89f5 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -558,7 +558,7 @@ public:
void cleanup_fragments(long start,
long end);
- void cursor_down();
+ void cursor_down(bool explicit_sequence);
void drop_scrollback();
void restore_cursor(VteScreen *screen__);
diff --git a/src/vteseq.cc b/src/vteseq.cc
index a8e66fe5..3f8467e6 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -1660,7 +1660,7 @@ static void
vte_sequence_handler_next_line (VteTerminalPrivate *that, GValueArray *params)
{
that->set_cursor_column(0);
- that->cursor_down();
+ that->cursor_down(true);
}
/* No-op. */
@@ -1817,7 +1817,7 @@ vte_sequence_handler_line_feed (VteTerminalPrivate *that, GValueArray *params)
{
that->ensure_cursor_is_onscreen();
- that->cursor_down();
+ that->cursor_down(true);
}
/* Cursor up 1 line, with scrolling. */