summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Hüsers2016-01-30 13:35:11 +0100
committerManuel Hüsers2016-01-30 13:35:11 +0100
commit5dd20b52e29062bcbec34cf343d158725bc0f649 (patch)
tree7b77e67f149a8bcd951f5744eaa21f4d93b5150f
parent04e9ea4c93990c1be138110ecd9a98d540a71ff0 (diff)
downloadaur-5dd20b52e29062bcbec34cf343d158725bc0f649.tar.gz
Version 0.42.3
-rw-r--r--.SRCINFO19
-rw-r--r--0001-emulation-Track-the-cursor-separately-for-the-two-sc.patch1040
-rw-r--r--PKGBUILD16
-rw-r--r--vte291-command-notify.patch34
4 files changed, 1079 insertions, 30 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8adf739f6ceb..5b2bf7b76496 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,8 @@
+# Generated by mksrcinfo v8
+# Sat Jan 30 12:35:11 UTC 2016
pkgbase = vte3-notification
pkgdesc = Virtual Terminal Emulator widget for use with GTK3
- pkgver = 0.42.1
+ pkgver = 0.42.3
pkgrel = 1
url = https://www.gnome.org
arch = i686
@@ -11,24 +13,27 @@ pkgbase = vte3-notification
makedepends = gtk3
makedepends = vala
makedepends = gperf
+ makedepends = glade
options = !emptydirs
- source = https://download.gnome.org/sources/vte/0.42/vte-0.42.1.tar.xz
+ source = https://download.gnome.org/sources/vte/0.42/vte-0.42.3.tar.xz
source = 0001-widget-Only-show-the-cursor-on-motion-if-moved.patch
- source = add-zsh-notfication-support.patch
+ source = 0001-emulation-Track-the-cursor-separately-for-the-two-sc.patch
source = vte291-command-notify.patch
- sha256sums = 9e00e2e9e94f4202b979c871f407a8815890bc0f4a8448a08534f76ab0fc9d34
+ source = add-zsh-notfication-support.patch
+ sha256sums = 96e98a40eae82d04c08f2ca1d2672659596e5b75626ba7d78df2412878ae62a0
sha256sums = 4379593bdddbe7ebcf6efd808f6334ce86334426d07f7ad777a3aa2d1ee2c50d
+ sha256sums = 2a3a37001077f271fa252b1ed3cf21c7fc2f046dbcc46df52f61aebf5284b19c
+ sha256sums = f6eb91bdd27f29560e767b529c4e08d7fccf7ceae78fb45a44a511fde55c9a32
sha256sums = 150a151404ca565f70259044661b2ef5cda43142ca677e7da324614eef8cf45a
- sha256sums = d7dce79b0950b35052f60cacc7ce835a6111a4f3e833a5406590ff141fb41825
pkgname = vte3-notification
depends = gtk3
depends = vte-notification-common
- provides = vte3=0.42.1
+ provides = vte3=0.42.3
conflicts = vte3
pkgname = vte-notification-common
pkgdesc = Common files used by vte and vte3
- provides = vte-common=0.42.1
+ provides = vte-common=0.42.3
conflicts = vte-common
diff --git a/0001-emulation-Track-the-cursor-separately-for-the-two-sc.patch b/0001-emulation-Track-the-cursor-separately-for-the-two-sc.patch
new file mode 100644
index 000000000000..4c29eee515c0
--- /dev/null
+++ b/0001-emulation-Track-the-cursor-separately-for-the-two-sc.patch
@@ -0,0 +1,1040 @@
+From fff3b5f904d3b6d1deb9beec9ae871b135696966 Mon Sep 17 00:00:00 2001
+From: Egmont Koblinger <egmont@gmail.com>
+Date: Thu, 28 Jan 2016 14:09:55 +0100
+Subject: [PATCH] emulation: Track the cursor separately for the two screens
+
+This is required to correctly resize the normal screen's contents
+while the alternate screen is active, fixing a bug introduced by
+commit 5a434e6c4457bdfe182a13213396e7a66a08f767.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=761097
+---
+ src/vte.cc | 160 +++++++++++++++++++++++++----------------------------
+ src/vteinternal.hh | 4 +-
+ src/vteseq.cc | 152 +++++++++++++++++++++++++-------------------------
+ 3 files changed, 153 insertions(+), 163 deletions(-)
+
+diff --git a/src/vte.cc b/src/vte.cc
+index 3a9a116d1973..701891ba93b3 100644
+--- a/src/vte.cc
++++ b/src/vte.cc
+@@ -743,8 +743,8 @@ _vte_invalidate_cursor_once(VteTerminal *terminal, gboolean periodic)
+ if (terminal->pvt->cursor_visible) {
+ preedit_width = vte_terminal_preedit_width(terminal, FALSE);
+
+- row = terminal->pvt->cursor.row;
+- column = terminal->pvt->cursor.col;
++ row = terminal->pvt->screen->cursor.row;
++ column = terminal->pvt->screen->cursor.col;
+ columns = 1;
+ column = find_start_column (terminal, column, row);
+ cell = vte_terminal_find_charcell(terminal, column, row);
+@@ -1843,8 +1843,7 @@ _vte_terminal_adjust_adjustments(VteTerminal *terminal)
+ * area. Leave the scrolling delta alone because it will be updated
+ * when the adjustment changes. */
+ screen->insert_delta = MAX(screen->insert_delta, delta);
+- terminal->pvt->cursor.row = MAX(terminal->pvt->cursor.row,
+- screen->insert_delta);
++ screen->cursor.row = MAX(screen->cursor.row, screen->insert_delta);
+
+ if (screen->scroll_delta > screen->insert_delta) {
+ vte_terminal_queue_adjustment_value_changed(terminal,
+@@ -2137,7 +2136,7 @@ _vte_terminal_ensure_row (VteTerminal *terminal)
+
+ /* Must make sure we're in a sane area. */
+ screen = terminal->pvt->screen;
+- v = terminal->pvt->cursor.row;
++ v = screen->cursor.row;
+
+ /* Figure out how many rows we need to add. */
+ delta = v - _vte_ring_next(screen->row_data) + 1;
+@@ -2159,7 +2158,7 @@ vte_terminal_ensure_cursor(VteTerminal *terminal)
+ VteRowData *row;
+
+ row = _vte_terminal_ensure_row (terminal);
+- _vte_row_data_fill (row, &basic_cell.cell, terminal->pvt->cursor.col);
++ _vte_row_data_fill (row, &basic_cell.cell, terminal->pvt->screen->cursor.col);
+
+ return row;
+ }
+@@ -2177,7 +2176,7 @@ _vte_terminal_update_insert_delta(VteTerminal *terminal)
+ /* The total number of lines. Add one to the cursor offset
+ * because it's zero-based. */
+ rows = _vte_ring_next (screen->row_data);
+- delta = terminal->pvt->cursor.row - rows + 1;
++ delta = screen->cursor.row - rows + 1;
+ if (G_UNLIKELY (delta > 0)) {
+ vte_terminal_insert_rows (terminal, delta);
+ rows = _vte_ring_next (screen->row_data);
+@@ -2189,7 +2188,7 @@ _vte_terminal_update_insert_delta(VteTerminal *terminal)
+ delta = screen->insert_delta;
+ delta = MIN(delta, rows - terminal->pvt->row_count);
+ delta = MAX(delta,
+- terminal->pvt->cursor.row - (terminal->pvt->row_count - 1));
++ screen->cursor.row - (terminal->pvt->row_count - 1));
+ delta = MAX(delta, _vte_ring_delta(screen->row_data));
+
+ /* Adjust the insert delta and scroll if needed. */
+@@ -2921,7 +2920,7 @@ _vte_terminal_cleanup_fragments(VteTerminal *terminal,
+ cell_end->attr.columns = 1;
+ _vte_invalidate_cells(terminal,
+ end, 1,
+- terminal->pvt->cursor.row, 1);
++ terminal->pvt->screen->cursor.row, 1);
+ }
+ }
+
+@@ -2947,7 +2946,7 @@ _vte_terminal_cleanup_fragments(VteTerminal *terminal,
+ g_assert(start - col == 1);
+ _vte_invalidate_cells(terminal,
+ col, 1,
+- terminal->pvt->cursor.row, 1);
++ terminal->pvt->screen->cursor.row, 1);
+ }
+ keep_going = FALSE;
+ }
+@@ -2974,19 +2973,19 @@ _vte_terminal_cursor_down (VteTerminal *terminal)
+ start = screen->insert_delta;
+ end = start + terminal->pvt->row_count - 1;
+ }
+- if (terminal->pvt->cursor.row == end) {
++ if (screen->cursor.row == end) {
+ if (terminal->pvt->scrolling_restricted) {
+ if (start == screen->insert_delta) {
+ /* Scroll this line into the scrollback
+ * buffer by inserting a line at the next
+ * line and scrolling the area up. */
+ screen->insert_delta++;
+- terminal->pvt->cursor.row++;
++ screen->cursor.row++;
+ /* update start and end, as they are relative
+ * to insert_delta. */
+ start++;
+ end++;
+- _vte_terminal_ring_insert (terminal, terminal->pvt->cursor.row, FALSE);
++ _vte_terminal_ring_insert (terminal, screen->cursor.row, FALSE);
+ /* Force the areas below the region to be
+ * redrawn -- they've moved. */
+ _vte_terminal_scroll_region(terminal, start,
+@@ -3008,7 +3007,7 @@ _vte_terminal_cursor_down (VteTerminal *terminal)
+ }
+ } else {
+ /* Scroll up with history. */
+- terminal->pvt->cursor.row++;
++ screen->cursor.row++;
+ _vte_terminal_update_insert_delta(terminal);
+ }
+
+@@ -3020,7 +3019,7 @@ _vte_terminal_cursor_down (VteTerminal *terminal)
+ }
+ } else {
+ /* Otherwise, just move the cursor down. */
+- terminal->pvt->cursor.row++;
++ screen->cursor.row++;
+ }
+ }
+
+@@ -3042,9 +3041,9 @@ _vte_terminal_drop_scrollback (VteTerminal *terminal)
+ void
+ _vte_terminal_restore_cursor (VteTerminal *terminal, VteScreen *screen)
+ {
+- terminal->pvt->cursor.col = screen->saved.cursor.col;
+- terminal->pvt->cursor.row = screen->insert_delta + CLAMP(screen->saved.cursor.row,
+- 0, terminal->pvt->row_count - 1);
++ screen->cursor.col = screen->saved.cursor.col;
++ screen->cursor.row = screen->insert_delta + CLAMP(screen->saved.cursor.row,
++ 0, terminal->pvt->row_count - 1);
+
+ terminal->pvt->reverse_mode = screen->saved.reverse_mode;
+ terminal->pvt->origin_mode = screen->saved.origin_mode;
+@@ -3063,8 +3062,8 @@ _vte_terminal_restore_cursor (VteTerminal *terminal, VteScreen *screen)
+ void
+ _vte_terminal_save_cursor (VteTerminal *terminal, VteScreen *screen)
+ {
+- screen->saved.cursor.col = terminal->pvt->cursor.col;
+- screen->saved.cursor.row = terminal->pvt->cursor.row - screen->insert_delta;
++ screen->saved.cursor.col = screen->cursor.col;
++ screen->saved.cursor.row = screen->cursor.row - screen->insert_delta;
+
+ screen->saved.reverse_mode = terminal->pvt->reverse_mode;
+ screen->saved.origin_mode = terminal->pvt->origin_mode;
+@@ -3144,21 +3143,21 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
+ columns = _vte_unichar_width(c, terminal->pvt->utf8_ambiguous_width);
+
+ /* If we're autowrapping here, do it. */
+- col = terminal->pvt->cursor.col;
++ col = screen->cursor.col;
+ if (G_UNLIKELY (columns && col + columns > terminal->pvt->column_count)) {
+ if (terminal->pvt->autowrap) {
+ _vte_debug_print(VTE_DEBUG_ADJ,
+ "Autowrapping before character\n");
+ /* Wrap. */
+ /* XXX clear to the end of line */
+- col = terminal->pvt->cursor.col = 0;
++ col = screen->cursor.col = 0;
+ /* Mark this line as soft-wrapped. */
+ row = _vte_terminal_ensure_row (terminal);
+ row->attr.soft_wrapped = 1;
+ _vte_terminal_cursor_down (terminal);
+ } else {
+ /* Don't wrap, stay at the rightmost column. */
+- col = terminal->pvt->cursor.col =
++ col = screen->cursor.col =
+ terminal->pvt->column_count - columns;
+ }
+ line_wrapped = TRUE;
+@@ -3169,7 +3168,7 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
+ (long)c, c < 256 ? c : ' ',
+ (int)terminal->pvt->color_defaults.attr.fore,
+ (int)terminal->pvt->color_defaults.attr.back,
+- col, columns, (long)terminal->pvt->cursor.row,
++ col, columns, (long)screen->cursor.row,
+ (long)screen->insert_delta);
+
+
+@@ -3182,7 +3181,7 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
+
+ _vte_debug_print(VTE_DEBUG_PARSE, "combining U+%04X", c);
+
+- row_num = terminal->pvt->cursor.row;
++ row_num = screen->cursor.row;
+ row = NULL;
+ if (G_UNLIKELY (col == 0)) {
+ /* We are at first column. See if the previous line softwrapped.
+@@ -3282,10 +3281,10 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
+ _vte_invalidate_cells(terminal,
+ col - columns,
+ insert ? terminal->pvt->column_count : columns,
+- terminal->pvt->cursor.row, 1);
++ screen->cursor.row, 1);
+ }
+
+- terminal->pvt->cursor.col = col;
++ screen->cursor.col = col;
+
+ done:
+ /* We added text, so make a note of it. */
+@@ -3724,12 +3723,12 @@ vte_terminal_process_incoming(VteTerminal *terminal)
+ bottom = screen->insert_delta == delta;
+
+ /* Save the current cursor position. */
+- cursor = terminal->pvt->cursor;
++ cursor = screen->cursor;
+ cursor_visible = terminal->pvt->cursor_visible;
+
+ in_scroll_region = terminal->pvt->scrolling_restricted
+- && (terminal->pvt->cursor.row >= (screen->insert_delta + terminal->pvt->scrolling_region.start))
+- && (terminal->pvt->cursor.row <= (screen->insert_delta + terminal->pvt->scrolling_region.end));
++ && (screen->cursor.row >= (screen->insert_delta + terminal->pvt->scrolling_region.start))
++ && (screen->cursor.row <= (screen->insert_delta + terminal->pvt->scrolling_region.end));
+
+ /* We should only be called when there's data to process. */
+ g_assert(terminal->pvt->incoming ||
+@@ -3839,8 +3838,8 @@ skip_chunk:
+ modified = TRUE;
+
+ new_in_scroll_region = terminal->pvt->scrolling_restricted
+- && (terminal->pvt->cursor.row >= (screen->insert_delta + terminal->pvt->scrolling_region.start))
+- && (terminal->pvt->cursor.row <= (screen->insert_delta + terminal->pvt->scrolling_region.end));
++ && (screen->cursor.row >= (screen->insert_delta + terminal->pvt->scrolling_region.start))
++ && (screen->cursor.row <= (screen->insert_delta + terminal->pvt->scrolling_region.end));
+
+ delta = screen->scroll_delta; /* delta may have changed from sequence. */
+
+@@ -3849,10 +3848,10 @@ skip_chunk:
+ */
+ if (invalidated_text &&
+ ((new_in_scroll_region && !in_scroll_region) ||
+- (terminal->pvt->cursor.col > bbox_bottomright.x + VTE_CELL_BBOX_SLACK ||
+- terminal->pvt->cursor.col < bbox_topleft.x - VTE_CELL_BBOX_SLACK ||
+- terminal->pvt->cursor.row > bbox_bottomright.y + VTE_CELL_BBOX_SLACK ||
+- terminal->pvt->cursor.row < bbox_topleft.y - VTE_CELL_BBOX_SLACK))) {
++ (screen->cursor.col > bbox_bottomright.x + VTE_CELL_BBOX_SLACK ||
++ screen->cursor.col < bbox_topleft.x - VTE_CELL_BBOX_SLACK ||
++ screen->cursor.row > bbox_bottomright.y + VTE_CELL_BBOX_SLACK ||
++ screen->cursor.row < bbox_topleft.y - VTE_CELL_BBOX_SLACK))) {
+ /* Clip off any part of the box which isn't already on-screen. */
+ bbox_topleft.x = MAX(bbox_topleft.x, 0);
+ bbox_topleft.y = MAX(bbox_topleft.y, delta);
+@@ -3931,20 +3930,18 @@ skip_chunk:
+ }
+ }
+
+- bbox_topleft.x = MIN(bbox_topleft.x,
+- terminal->pvt->cursor.col);
+- bbox_topleft.y = MIN(bbox_topleft.y,
+- terminal->pvt->cursor.row);
++ bbox_topleft.x = MIN(bbox_topleft.x, screen->cursor.col);
++ bbox_topleft.y = MIN(bbox_topleft.y, screen->cursor.row);
+
+ /* Insert the character. */
+ if (G_UNLIKELY (_vte_terminal_insert_char(terminal, c,
+ FALSE, FALSE))) {
+ /* line wrapped, correct bbox */
+ if (invalidated_text &&
+- (terminal->pvt->cursor.col > bbox_bottomright.x + VTE_CELL_BBOX_SLACK ||
+- terminal->pvt->cursor.col < bbox_topleft.x - VTE_CELL_BBOX_SLACK ||
+- terminal->pvt->cursor.row > bbox_bottomright.y + VTE_CELL_BBOX_SLACK ||
+- terminal->pvt->cursor.row < bbox_topleft.y - VTE_CELL_BBOX_SLACK)) {
++ (screen->cursor.col > bbox_bottomright.x + VTE_CELL_BBOX_SLACK ||
++ screen->cursor.col < bbox_topleft.x - VTE_CELL_BBOX_SLACK ||
++ screen->cursor.row > bbox_bottomright.y + VTE_CELL_BBOX_SLACK ||
++ screen->cursor.row < bbox_topleft.y - VTE_CELL_BBOX_SLACK)) {
+ /* Clip off any part of the box which isn't already on-screen. */
+ bbox_topleft.x = MAX(bbox_topleft.x, 0);
+ bbox_topleft.y = MAX(bbox_topleft.y, delta);
+@@ -3964,16 +3961,13 @@ skip_chunk:
+
+ }
+ bbox_topleft.x = MIN(bbox_topleft.x, 0);
+- bbox_topleft.y = MIN(bbox_topleft.y,
+- terminal->pvt->cursor.row);
++ bbox_topleft.y = MIN(bbox_topleft.y, screen->cursor.row);
+ }
+ /* Add the cells over which we have moved to the region
+ * which we need to refresh for the user. */
+- bbox_bottomright.x = MAX(bbox_bottomright.x,
+- terminal->pvt->cursor.col);
++ bbox_bottomright.x = MAX(bbox_bottomright.x, screen->cursor.col);
+ /* cursor.row + 1 (defer until inv.) */
+- bbox_bottomright.y = MAX(bbox_bottomright.y,
+- terminal->pvt->cursor.row);
++ bbox_bottomright.y = MAX(bbox_bottomright.y, screen->cursor.row);
+ invalidated_text = TRUE;
+
+ /* We *don't* emit flush pending signals here. */
+@@ -4007,7 +4001,7 @@ skip_chunk:
+ _vte_ring_delta(screen->row_data));
+ /* The cursor shouldn't be above or below the addressable
+ * part of the display buffer. */
+- g_assert(terminal->pvt->cursor.row >= terminal->pvt->screen->insert_delta);
++ g_assert(screen->cursor.row >= screen->insert_delta);
+ #endif
+
+ next_match:
+@@ -4082,8 +4076,8 @@ next_match:
+ }
+
+
+- if ((cursor.col != terminal->pvt->cursor.col) ||
+- (cursor.row != terminal->pvt->cursor.row)) {
++ if ((cursor.col != terminal->pvt->screen->cursor.col) ||
++ (cursor.row != terminal->pvt->screen->cursor.row)) {
+ /* invalidate the old and new cursor positions */
+ if (cursor_visible)
+ _vte_invalidate_cell(terminal, cursor.col, cursor.row);
+@@ -4099,11 +4093,9 @@ next_match:
+ /* Tell the input method where the cursor is. */
+ if (gtk_widget_get_realized (&terminal->widget)) {
+ GdkRectangle rect;
+- rect.x = terminal->pvt->cursor.col *
+- terminal->pvt->char_width + terminal->pvt->padding.left;
++ rect.x = terminal->pvt->screen->cursor.col * terminal->pvt->char_width + terminal->pvt->padding.left;
+ rect.width = terminal->pvt->char_width;
+- rect.y = (terminal->pvt->cursor.row - delta) *
+- terminal->pvt->char_height + terminal->pvt->padding.top;
++ rect.y = (terminal->pvt->screen->cursor.row - delta) * terminal->pvt->char_height + terminal->pvt->padding.top;
+ rect.height = terminal->pvt->char_height;
+ gtk_im_context_set_cursor_location(terminal->pvt->im_context,
+ &rect);
+@@ -4830,8 +4822,7 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
+ /* If we're in margin bell mode and on the border of the
+ * margin, bell. */
+ if (terminal->pvt->margin_bell) {
+- if ((terminal->pvt->cursor.col +
+- (glong) terminal->pvt->bell_margin) ==
++ if ((terminal->pvt->screen->cursor.col + (glong) terminal->pvt->bell_margin) ==
+ terminal->pvt->column_count) {
+ _vte_terminal_beep (terminal);
+ }
+@@ -6530,10 +6521,10 @@ vte_terminal_get_cursor_position(VteTerminal *terminal,
+ {
+ g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ if (column) {
+- *column = terminal->pvt->cursor.col;
++ *column = terminal->pvt->screen->cursor.col;
+ }
+ if (row) {
+- *row = terminal->pvt->cursor.row;
++ *row = terminal->pvt->screen->cursor.row;
+ }
+ }
+
+@@ -8058,14 +8049,14 @@ vte_terminal_screen_set_size(VteTerminal *terminal, VteScreen *screen, glong old
+ " cursor_saved (relative to insert_delta) row=%ld col=%ld\n",
+ screen == &terminal->pvt->normal_screen ? "normal" : "alternate",
+ screen->insert_delta, screen->scroll_delta,
+- terminal->pvt->cursor.row, terminal->pvt->cursor.row - screen->scroll_delta + 1, terminal->pvt->cursor.col,
++ screen->cursor.row, screen->cursor.row - screen->scroll_delta + 1, screen->cursor.col,
+ screen->saved.cursor.row, screen->saved.cursor.col);
+
+ cursor_saved_absolute.row = screen->saved.cursor.row + screen->insert_delta;
+ cursor_saved_absolute.col = screen->saved.cursor.col;
+ below_viewport.row = screen->scroll_delta + old_rows;
+ below_viewport.col = 0;
+- below_current_paragraph.row = terminal->pvt->cursor.row + 1;
++ below_current_paragraph.row = screen->cursor.row + 1;
+ while (below_current_paragraph.row < _vte_ring_next(ring)
+ && _vte_ring_index(ring, below_current_paragraph.row - 1)->attr.soft_wrapped) {
+ below_current_paragraph.row++;
+@@ -8075,15 +8066,12 @@ vte_terminal_screen_set_size(VteTerminal *terminal, VteScreen *screen, glong old
+ markers[0] = &cursor_saved_absolute;
+ markers[1] = &below_viewport;
+ markers[2] = &below_current_paragraph;
+- if (screen == terminal->pvt->screen) {
+- /* Tracking the current cursor only makes sense on the active screen. */
+- markers[3] = &terminal->pvt->cursor;
+- if (terminal->pvt->has_selection) {
+- /* selection_end is inclusive, make it non-inclusive, see bug 722635. */
+- terminal->pvt->selection_end.col++;
+- markers[4] = &terminal->pvt->selection_start;
+- markers[5] = &terminal->pvt->selection_end;
+- }
++ markers[3] = &screen->cursor;
++ if (terminal->pvt->has_selection) {
++ /* selection_end is inclusive, make it non-inclusive, see bug 722635. */
++ terminal->pvt->selection_end.col++;
++ markers[4] = &terminal->pvt->selection_start;
++ markers[5] = &terminal->pvt->selection_end;
+ }
+
+ old_top_lines = below_current_paragraph.row - screen->insert_delta;
+@@ -8111,7 +8099,7 @@ vte_terminal_screen_set_size(VteTerminal *terminal, VteScreen *screen, glong old
+ }
+ }
+
+- if (screen == terminal->pvt->screen && terminal->pvt->has_selection) {
++ if (terminal->pvt->has_selection) {
+ /* Make selection_end inclusive again, see above. */
+ terminal->pvt->selection_end.col--;
+ }
+@@ -8160,7 +8148,7 @@ vte_terminal_screen_set_size(VteTerminal *terminal, VteScreen *screen, glong old
+ " cursor (absolute) row=%ld (visual line %ld) col=%ld\n"
+ " cursor_saved (relative to insert_delta) row=%ld col=%ld\n\n",
+ screen->insert_delta, new_scroll_delta,
+- terminal->pvt->cursor.row, terminal->pvt->cursor.row - new_scroll_delta + 1, terminal->pvt->cursor.col,
++ screen->cursor.row, screen->cursor.row - new_scroll_delta + 1, screen->cursor.col,
+ screen->saved.cursor.row, screen->saved.cursor.col);
+
+ if (screen == terminal->pvt->screen)
+@@ -8225,10 +8213,10 @@ vte_terminal_set_size(VteTerminal *terminal, glong columns, glong rows)
+ vte_terminal_set_scrollback_lines(terminal,
+ terminal->pvt->scrollback_lines);
+ /* Ensure the cursor is valid */
+- terminal->pvt->cursor.row = CLAMP (terminal->pvt->cursor.row,
+- _vte_ring_delta (terminal->pvt->screen->row_data),
+- MAX (_vte_ring_delta (terminal->pvt->screen->row_data),
+- _vte_ring_next (terminal->pvt->screen->row_data) - 1));
++ terminal->pvt->screen->cursor.row = CLAMP (terminal->pvt->screen->cursor.row,
++ _vte_ring_delta (terminal->pvt->screen->row_data),
++ MAX (_vte_ring_delta (terminal->pvt->screen->row_data),
++ _vte_ring_next (terminal->pvt->screen->row_data) - 1));
+
+ _vte_terminal_adjust_adjustments_full (terminal);
+ gtk_widget_queue_resize_no_redraw (&terminal->widget);
+@@ -9963,8 +9951,8 @@ vte_terminal_paint_cursor(VteTerminal *terminal)
+
+ screen = terminal->pvt->screen;
+ delta = screen->scroll_delta;
+- col = terminal->pvt->cursor.col;
+- drow = terminal->pvt->cursor.row;
++ col = screen->cursor.col;
++ drow = screen->cursor.row;
+ row = drow - delta;
+ width = terminal->pvt->char_width;
+ height = terminal->pvt->char_height;
+@@ -10104,7 +10092,7 @@ vte_terminal_paint_im_preedit_string(VteTerminal *terminal)
+ height = terminal->pvt->char_height;
+ delta = screen->scroll_delta;
+
+- row = terminal->pvt->cursor.row - delta;
++ row = screen->cursor.row - delta;
+
+ /* Find out how many columns the pre-edit string takes up. */
+ columns = vte_terminal_preedit_width(terminal, FALSE);
+@@ -10112,7 +10100,7 @@ vte_terminal_paint_im_preedit_string(VteTerminal *terminal)
+
+ /* If the pre-edit string won't fit on the screen if we start
+ * drawing it at the cursor's position, move it left. */
+- col = terminal->pvt->cursor.col;
++ col = screen->cursor.col;
+ if (col + columns > terminal->pvt->column_count) {
+ col = MAX(0, terminal->pvt->column_count - columns);
+ }
+@@ -12035,7 +12023,7 @@ vte_terminal_set_scrollback_lines(VteTerminal *terminal, glong lines)
+ /* The main screen gets the full scrollback buffer. */
+ screen = &terminal->pvt->normal_screen;
+ lines = MAX (lines, terminal->pvt->row_count);
+- next = MAX (terminal->pvt->cursor.row + 1,
++ next = MAX (screen->cursor.row + 1,
+ _vte_ring_next (screen->row_data));
+ _vte_ring_resize (screen->row_data, lines);
+ low = _vte_ring_delta (screen->row_data);
+@@ -12234,10 +12222,12 @@ vte_terminal_reset(VteTerminal *terminal,
+ pvt->screen = &pvt->normal_screen;
+ pvt->normal_screen.scroll_delta = pvt->normal_screen.insert_delta =
+ _vte_ring_reset(pvt->normal_screen.row_data);
++ pvt->normal_screen.cursor.row = pvt->normal_screen.insert_delta;
++ pvt->normal_screen.cursor.col = 0;
+ pvt->alternate_screen.scroll_delta = pvt->alternate_screen.insert_delta =
+ _vte_ring_reset(pvt->alternate_screen.row_data);
+- pvt->cursor.row = pvt->screen->insert_delta;
+- pvt->cursor.col = 0;
++ pvt->alternate_screen.cursor.row = pvt->alternate_screen.insert_delta;
++ pvt->alternate_screen.cursor.col = 0;
+ /* Adjust the scrollbar to the new location. */
+ /* Hack: force a change in scroll_delta even if the value remains, so that
+ vte_term_q_adj_val_changed() doesn't shortcut to no-op, see bug 730599. */
+diff --git a/src/vteinternal.hh b/src/vteinternal.hh
+index 04d8104b044d..f2152e6a8853 100644
+--- a/src/vteinternal.hh
++++ b/src/vteinternal.hh
+@@ -102,12 +102,13 @@ struct _vte_incoming_chunk{
+ typedef struct _VteScreen VteScreen;
+ struct _VteScreen {
+ VteRing row_data[1]; /* buffer contents */
++ VteVisualPosition cursor; /* absolute value, from the beginning of the terminal history */
+ long scroll_delta; /* scroll offset */
+ long insert_delta; /* insertion offset */
+
+ /* Stuff saved along with the cursor */
+ struct {
+- VteVisualPosition cursor;
++ VteVisualPosition cursor; /* onscreen coordinate, that is, relative to insert_delta */
+ gboolean reverse_mode;
+ gboolean origin_mode;
+ gboolean sendrecv_mode;
+@@ -208,7 +209,6 @@ public:
+ struct _VteScreen normal_screen, alternate_screen, *screen;
+
+ /* Values we save along with the cursor */
+- VteVisualPosition cursor; /* relative to the insertion delta */
+ gboolean reverse_mode; /* reverse mode */
+ gboolean origin_mode; /* origin mode */
+ gboolean sendrecv_mode; /* sendrecv mode */
+diff --git a/src/vteseq.cc b/src/vteseq.cc
+index af27ff5ef277..bf76995165bb 100644
+--- a/src/vteseq.cc
++++ b/src/vteseq.cc
+@@ -261,8 +261,8 @@ vte_terminal_emit_resize_window(VteTerminal *terminal,
+ static void
+ _vte_terminal_ensure_cursor_is_onscreen (VteTerminal *terminal)
+ {
+- if (G_UNLIKELY (terminal->pvt->cursor.col >= terminal->pvt->column_count))
+- terminal->pvt->cursor.col = terminal->pvt->column_count - 1;
++ if (G_UNLIKELY (terminal->pvt->screen->cursor.col >= terminal->pvt->column_count))
++ terminal->pvt->screen->cursor.col = terminal->pvt->column_count - 1;
+ }
+
+ static void
+@@ -279,8 +279,8 @@ _vte_terminal_home_cursor (VteTerminal *terminal)
+ origin = 0;
+ }
+
+- terminal->pvt->cursor.row = screen->insert_delta + origin;
+- terminal->pvt->cursor.col = 0;
++ screen->cursor.row = screen->insert_delta + origin;
++ screen->cursor.col = 0;
+ }
+
+ /* Clear the entire screen. */
+@@ -291,7 +291,7 @@ _vte_terminal_clear_screen (VteTerminal *terminal)
+ VteScreen *screen;
+ screen = terminal->pvt->screen;
+ initial = screen->insert_delta;
+- row = terminal->pvt->cursor.row - screen->insert_delta;
++ row = screen->cursor.row - screen->insert_delta;
+ initial = _vte_ring_next(screen->row_data);
+ /* Add a new screen's worth of rows. */
+ for (i = 0; i < terminal->pvt->row_count; i++)
+@@ -299,7 +299,7 @@ _vte_terminal_clear_screen (VteTerminal *terminal)
+ /* Move the cursor and insertion delta to the first line in the
+ * newly-cleared area and scroll if need be. */
+ screen->insert_delta = initial;
+- terminal->pvt->cursor.row = row + screen->insert_delta;
++ screen->cursor.row = row + screen->insert_delta;
+ _vte_terminal_adjust_adjustments(terminal);
+ /* Redraw everything. */
+ _vte_invalidate_all(terminal);
+@@ -318,9 +318,9 @@ _vte_terminal_clear_current_line (VteTerminal *terminal)
+
+ /* If the cursor is actually on the screen, clear data in the row
+ * which corresponds to the cursor. */
+- if (_vte_ring_next(screen->row_data) > terminal->pvt->cursor.row) {
++ if (_vte_ring_next(screen->row_data) > screen->cursor.row) {
+ /* Get the data for the row which the cursor points to. */
+- rowdata = _vte_ring_index_writable (screen->row_data, terminal->pvt->cursor.row);
++ rowdata = _vte_ring_index_writable (screen->row_data, screen->cursor.row);
+ g_assert(rowdata != NULL);
+ /* Remove it. */
+ _vte_row_data_shrink (rowdata, 0);
+@@ -330,7 +330,7 @@ _vte_terminal_clear_current_line (VteTerminal *terminal)
+ /* Repaint this row. */
+ _vte_invalidate_cells(terminal,
+ 0, terminal->pvt->column_count,
+- terminal->pvt->cursor.row, 1);
++ screen->cursor.row, 1);
+ }
+
+ /* We've modified the display. Make a note of it. */
+@@ -347,7 +347,7 @@ _vte_terminal_clear_above_current (VteTerminal *terminal)
+ screen = terminal->pvt->screen;
+ /* If the cursor is actually on the screen, clear data in the row
+ * which corresponds to the cursor. */
+- for (i = screen->insert_delta; i < terminal->pvt->cursor.row; i++) {
++ for (i = screen->insert_delta; i < screen->cursor.row; i++) {
+ if (_vte_ring_next(screen->row_data) > i) {
+ /* Get the data for the row we're erasing. */
+ rowdata = _vte_ring_index_writable (screen->row_data, i);
+@@ -430,9 +430,9 @@ static void
+ vte_sequence_handler_normal_screen (VteTerminal *terminal, GValueArray *params)
+ {
+ /* cursor.row includes insert_delta, adjust accordingly */
+- terminal->pvt->cursor.row -= terminal->pvt->screen->insert_delta;
++ long cr = terminal->pvt->screen->cursor.row - terminal->pvt->screen->insert_delta;
+ terminal->pvt->screen = &terminal->pvt->normal_screen;
+- terminal->pvt->cursor.row += terminal->pvt->screen->insert_delta;
++ terminal->pvt->screen->cursor.row = cr + terminal->pvt->screen->insert_delta;
+
+ /* Make sure the ring is large enough */
+ _vte_terminal_ensure_row(terminal);
+@@ -443,9 +443,9 @@ static void
+ vte_sequence_handler_alternate_screen (VteTerminal *terminal, GValueArray *params)
+ {
+ /* cursor.row includes insert_delta, adjust accordingly */
+- terminal->pvt->cursor.row -= terminal->pvt->screen->insert_delta;
++ long cr = terminal->pvt->screen->cursor.row - terminal->pvt->screen->insert_delta;
+ terminal->pvt->screen = &terminal->pvt->alternate_screen;
+- terminal->pvt->cursor.row += terminal->pvt->screen->insert_delta;
++ terminal->pvt->screen->cursor.row = cr + terminal->pvt->screen->insert_delta;
+
+ /* Make sure the ring is large enough */
+ _vte_terminal_ensure_row(terminal);
+@@ -591,7 +591,7 @@ vte_sequence_handler_multiple_r(VteTerminal *terminal,
+ VteTerminalSequenceHandler handler)
+ {
+ vte_sequence_handler_multiple_limited(terminal, params, handler,
+- terminal->pvt->column_count - terminal->pvt->cursor.col);
++ terminal->pvt->column_count - terminal->pvt->screen->cursor.col);
+ }
+
+ static void
+@@ -1035,7 +1035,7 @@ vte_sequence_handler_cursor_back_tab (VteTerminal *terminal, GValueArray *params
+ long newcol;
+
+ /* Calculate which column is the previous tab stop. */
+- newcol = terminal->pvt->cursor.col;
++ newcol = terminal->pvt->screen->cursor.col;
+
+ if (terminal->pvt->tabstops != NULL) {
+ /* Find the next tabstop. */
+@@ -1051,7 +1051,7 @@ vte_sequence_handler_cursor_back_tab (VteTerminal *terminal, GValueArray *params
+ /* Warp the cursor. */
+ _vte_debug_print(VTE_DEBUG_PARSE,
+ "Moving cursor to column %ld.\n", (long)newcol);
+- terminal->pvt->cursor.col = newcol;
++ terminal->pvt->screen->cursor.col = newcol;
+ }
+
+ /* Clear from the cursor position (inclusive!) to the beginning of the line. */
+@@ -1067,11 +1067,11 @@ _vte_sequence_handler_cb (VteTerminal *terminal, GValueArray *params)
+ /* Get the data for the row which the cursor points to. */
+ rowdata = _vte_terminal_ensure_row(terminal);
+ /* Clean up Tab/CJK fragments. */
+- _vte_terminal_cleanup_fragments (terminal, 0, terminal->pvt->cursor.col + 1);
++ _vte_terminal_cleanup_fragments (terminal, 0, terminal->pvt->screen->cursor.col + 1);
+ /* Clear the data up to the current column with the default
+ * attributes. If there is no such character cell, we need
+ * to add one. */
+- for (i = 0; i <= terminal->pvt->cursor.col; i++) {
++ for (i = 0; i <= terminal->pvt->screen->cursor.col; i++) {
+ if (i < (glong) _vte_row_data_length (rowdata)) {
+ /* Muck with the cell in this location. */
+ pcell = _vte_row_data_get_writable (rowdata, i);
+@@ -1083,8 +1083,8 @@ _vte_sequence_handler_cb (VteTerminal *terminal, GValueArray *params)
+ }
+ /* Repaint this row. */
+ _vte_invalidate_cells(terminal,
+- 0, terminal->pvt->cursor.col+1,
+- terminal->pvt->cursor.row, 1);
++ 0, terminal->pvt->screen->cursor.col+1,
++ terminal->pvt->screen->cursor.row, 1);
+
+ /* We've modified the display. Make a note of it. */
+ terminal->pvt->text_deleted_flag = TRUE;
+@@ -1103,19 +1103,19 @@ _vte_sequence_handler_cd (VteTerminal *terminal, GValueArray *params)
+ screen = terminal->pvt->screen;
+ /* If the cursor is actually on the screen, clear the rest of the
+ * row the cursor is on and all of the rows below the cursor. */
+- i = terminal->pvt->cursor.row;
++ i = screen->cursor.row;
+ if (i < _vte_ring_next(screen->row_data)) {
+ /* Get the data for the row we're clipping. */
+ rowdata = _vte_ring_index_writable (screen->row_data, i);
+ /* Clean up Tab/CJK fragments. */
+- if ((glong) _vte_row_data_length (rowdata) > terminal->pvt->cursor.col)
+- _vte_terminal_cleanup_fragments (terminal, terminal->pvt->cursor.col, _vte_row_data_length (rowdata));
++ if ((glong) _vte_row_data_length (rowdata) > screen->cursor.col)
++ _vte_terminal_cleanup_fragments (terminal, screen->cursor.col, _vte_row_data_length (rowdata));
+ /* Clear everything to the right of the cursor. */
+ if (rowdata)
+- _vte_row_data_shrink (rowdata, terminal->pvt->cursor.col);
++ _vte_row_data_shrink (rowdata, screen->cursor.col);
+ }
+ /* Now for the rest of the lines. */
+- for (i = terminal->pvt->cursor.row + 1;
++ for (i = screen->cursor.row + 1;
+ i < _vte_ring_next(screen->row_data);
+ i++) {
+ /* Get the data for the row we're removing. */
+@@ -1125,7 +1125,7 @@ _vte_sequence_handler_cd (VteTerminal *terminal, GValueArray *params)
+ _vte_row_data_shrink (rowdata, 0);
+ }
+ /* Now fill the cleared areas. */
+- for (i = terminal->pvt->cursor.row;
++ for (i = screen->cursor.row;
+ i < screen->insert_delta + terminal->pvt->row_count;
+ i++) {
+ /* Retrieve the row's data, creating it if necessary. */
+@@ -1167,12 +1167,12 @@ _vte_sequence_handler_ce (VteTerminal *terminal, GValueArray *params)
+ /* Get the data for the row which the cursor points to. */
+ rowdata = _vte_terminal_ensure_row(terminal);
+ g_assert(rowdata != NULL);
+- if ((glong) _vte_row_data_length (rowdata) > terminal->pvt->cursor.col) {
++ if ((glong) _vte_row_data_length (rowdata) > terminal->pvt->screen->cursor.col) {
+ /* Clean up Tab/CJK fragments. */
+- _vte_terminal_cleanup_fragments (terminal, terminal->pvt->cursor.col, _vte_row_data_length (rowdata));
++ _vte_terminal_cleanup_fragments (terminal, terminal->pvt->screen->cursor.col, _vte_row_data_length (rowdata));
+ /* Remove the data at the end of the array until the current column
+ * is the end of the array. */
+- _vte_row_data_shrink (rowdata, terminal->pvt->cursor.col);
++ _vte_row_data_shrink (rowdata, terminal->pvt->screen->cursor.col);
+ /* We've modified the display. Make a note of it. */
+ terminal->pvt->text_deleted_flag = TRUE;
+ }
+@@ -1183,10 +1183,10 @@ _vte_sequence_handler_ce (VteTerminal *terminal, GValueArray *params)
+ rowdata->attr.soft_wrapped = 0;
+ /* Repaint this row. */
+ _vte_invalidate_cells(terminal,
+- terminal->pvt->cursor.col,
++ terminal->pvt->screen->cursor.col,
+ terminal->pvt->column_count -
+- terminal->pvt->cursor.col,
+- terminal->pvt->cursor.row, 1);
++ terminal->pvt->screen->cursor.col,
++ terminal->pvt->screen->cursor.row, 1);
+ }
+
+ /* Move the cursor to the given column (horizontal position), 1-based. */
+@@ -1206,7 +1206,7 @@ vte_sequence_handler_cursor_character_absolute (VteTerminal *terminal, GValueArr
+ }
+ }
+
+- terminal->pvt->cursor.col = val;
++ terminal->pvt->screen->cursor.col = val;
+ }
+
+ /* Move the cursor to the given position, 1-based. */
+@@ -1244,15 +1244,15 @@ vte_sequence_handler_cursor_position (VteTerminal *terminal, GValueArray *params
+ }
+ }
+ }
+- terminal->pvt->cursor.row = rowval + screen->insert_delta;
+- terminal->pvt->cursor.col = colval;
++ screen->cursor.row = rowval + screen->insert_delta;
++ screen->cursor.col = colval;
+ }
+
+ /* Carriage return. */
+ static void
+ vte_sequence_handler_carriage_return (VteTerminal *terminal, GValueArray *params)
+ {
+- terminal->pvt->cursor.col = 0;
++ terminal->pvt->screen->cursor.col = 0;
+ }
+
+ /* Restrict scrolling and updates to a subset of the visible lines. */
+@@ -1316,7 +1316,7 @@ vte_sequence_handler_set_scrolling_region (VteTerminal *terminal, GValueArray *p
+ static void
+ vte_sequence_handler_cursor_next_line (VteTerminal *terminal, GValueArray *params)
+ {
+- terminal->pvt->cursor.col = 0;
++ terminal->pvt->screen->cursor.col = 0;
+ vte_sequence_handler_cursor_down (terminal, params);
+ }
+
+@@ -1324,7 +1324,7 @@ vte_sequence_handler_cursor_next_line (VteTerminal *terminal, GValueArray *param
+ static void
+ vte_sequence_handler_cursor_preceding_line (VteTerminal *terminal, GValueArray *params)
+ {
+- terminal->pvt->cursor.col = 0;
++ terminal->pvt->screen->cursor.col = 0;
+ vte_sequence_handler_cursor_up (terminal, params);
+ }
+
+@@ -1356,7 +1356,7 @@ vte_sequence_handler_line_position_absolute (VteTerminal *terminal, GValueArray
+ }
+ val = val - 1 + origin;
+ val = CLAMP(val, origin, rowmax);
+- terminal->pvt->cursor.row = screen->insert_delta + val;
++ screen->cursor.row = screen->insert_delta + val;
+ }
+
+ /* Delete a character at the current cursor position. */
+@@ -1371,12 +1371,12 @@ _vte_sequence_handler_dc (VteTerminal *terminal, GValueArray *params)
+
+ screen = terminal->pvt->screen;
+
+- if (_vte_ring_next(screen->row_data) > terminal->pvt->cursor.row) {
++ if (_vte_ring_next(screen->row_data) > screen->cursor.row) {
+ long len;
+ /* Get the data for the row which the cursor points to. */
+- rowdata = _vte_ring_index_writable (screen->row_data, terminal->pvt->cursor.row);
++ rowdata = _vte_ring_index_writable (screen->row_data, screen->cursor.row);
+ g_assert(rowdata != NULL);
+- col = terminal->pvt->cursor.col;
++ col = screen->cursor.col;
+ len = _vte_row_data_length (rowdata);
+ /* Remove the column. */
+ if (col < len) {
+@@ -1390,7 +1390,7 @@ _vte_sequence_handler_dc (VteTerminal *terminal, GValueArray *params)
+ /* Repaint this row. */
+ _vte_invalidate_cells(terminal,
+ col, len - col,
+- terminal->pvt->cursor.row, 1);
++ screen->cursor.row, 1);
+ }
+ }
+
+@@ -1433,7 +1433,7 @@ vte_sequence_handler_cursor_down (VteTerminal *terminal, GValueArray *params)
+ }
+ }
+
+- terminal->pvt->cursor.row = MIN(terminal->pvt->cursor.row + val, end);
++ screen->cursor.row = MIN(screen->cursor.row + val, end);
+ }
+
+ /* Erase characters starting at the cursor position (overwriting N with
+@@ -1462,14 +1462,14 @@ vte_sequence_handler_erase_characters (VteTerminal *terminal, GValueArray *param
+
+ /* Clear out the given number of characters. */
+ rowdata = _vte_terminal_ensure_row(terminal);
+- if (_vte_ring_next(screen->row_data) > terminal->pvt->cursor.row) {
++ if (_vte_ring_next(screen->row_data) > screen->cursor.row) {
+ g_assert(rowdata != NULL);
+ /* Clean up Tab/CJK fragments. */
+- _vte_terminal_cleanup_fragments (terminal, terminal->pvt->cursor.col, terminal->pvt->cursor.col + count);
++ _vte_terminal_cleanup_fragments (terminal, screen->cursor.col, screen->cursor.col + count);
+ /* Write over the characters. (If there aren't enough, we'll
+ * need to create them.) */
+ for (i = 0; i < count; i++) {
+- col = terminal->pvt->cursor.col + i;
++ col = screen->cursor.col + i;
+ if (col >= 0) {
+ if (col < (glong) _vte_row_data_length (rowdata)) {
+ /* Replace this cell with the current
+@@ -1484,8 +1484,8 @@ vte_sequence_handler_erase_characters (VteTerminal *terminal, GValueArray *param
+ }
+ /* Repaint this row. */
+ _vte_invalidate_cells(terminal,
+- terminal->pvt->cursor.col, count,
+- terminal->pvt->cursor.row, 1);
++ screen->cursor.col, count,
++ screen->cursor.row, 1);
+ }
+
+ /* We've modified the display. Make a note of it. */
+@@ -1507,11 +1507,11 @@ _vte_sequence_handler_insert_character (VteTerminal *terminal, GValueArray *para
+
+ _vte_terminal_ensure_cursor_is_onscreen(terminal);
+
+- save = terminal->pvt->cursor;
++ save = terminal->pvt->screen->cursor;
+
+ _vte_terminal_insert_char(terminal, ' ', TRUE, TRUE);
+
+- terminal->pvt->cursor = save;
++ terminal->pvt->screen->cursor = save;
+ }
+
+ /* Insert N blank characters. */
+@@ -1535,9 +1535,9 @@ vte_sequence_handler_backspace (VteTerminal *terminal, GValueArray *params)
+ {
+ _vte_terminal_ensure_cursor_is_onscreen(terminal);
+
+- if (terminal->pvt->cursor.col > 0) {
++ if (terminal->pvt->screen->cursor.col > 0) {
+ /* There's room to move left, so do so. */
+- terminal->pvt->cursor.col--;
++ terminal->pvt->screen->cursor.col--;
+ }
+ }
+
+@@ -1557,7 +1557,7 @@ vte_sequence_handler_cursor_backward (VteTerminal *terminal, GValueArray *params
+ val = MAX(g_value_get_long(value), 1);
+ }
+ }
+- terminal->pvt->cursor.col = MAX(terminal->pvt->cursor.col - val, 0);
++ terminal->pvt->screen->cursor.col = MAX(terminal->pvt->screen->cursor.col - val, 0);
+ }
+
+ /* Cursor right N columns. */
+@@ -1578,9 +1578,9 @@ vte_sequence_handler_cursor_forward (VteTerminal *terminal, GValueArray *params)
+ }
+ }
+ /* The cursor can be further to the right, don't move in that case. */
+- if (terminal->pvt->cursor.col < terminal->pvt->column_count) {
++ if (terminal->pvt->screen->cursor.col < terminal->pvt->column_count) {
+ /* There's room to move right. */
+- terminal->pvt->cursor.col = MIN(terminal->pvt->cursor.col + val,
++ terminal->pvt->screen->cursor.col = MIN(terminal->pvt->screen->cursor.col + val,
+ terminal->pvt->column_count - 1);
+ }
+ }
+@@ -1589,7 +1589,7 @@ vte_sequence_handler_cursor_forward (VteTerminal *terminal, GValueArray *params)
+ static void
+ vte_sequence_handler_next_line (VteTerminal *terminal, GValueArray *params)
+ {
+- terminal->pvt->cursor.col = 0;
++ terminal->pvt->screen->cursor.col = 0;
+ _vte_terminal_cursor_down (terminal);
+ }
+
+@@ -1763,7 +1763,7 @@ vte_sequence_handler_reverse_index (VteTerminal *terminal, GValueArray *params)
+ end = start + terminal->pvt->row_count - 1;
+ }
+
+- if (terminal->pvt->cursor.row == start) {
++ if (screen->cursor.row == start) {
+ /* If we're at the top of the scrolling region, add a
+ * line at the top to scroll the bottom off. */
+ _vte_terminal_ring_remove (terminal, end);
+@@ -1775,7 +1775,7 @@ vte_sequence_handler_reverse_index (VteTerminal *terminal, GValueArray *params)
+ start, 2);
+ } else {
+ /* Otherwise, just move the cursor up. */
+- terminal->pvt->cursor.row--;
++ screen->cursor.row--;
+ }
+ /* Adjust the scrollbars if necessary. */
+ _vte_terminal_adjust_adjustments(terminal);
+@@ -1791,7 +1791,7 @@ vte_sequence_handler_tab_set (VteTerminal *terminal, GValueArray *params)
+ terminal->pvt->tabstops = g_hash_table_new(NULL, NULL);
+ }
+ _vte_terminal_set_tabstop(terminal,
+- terminal->pvt->cursor.col);
++ terminal->pvt->screen->cursor.col);
+ }
+
+ /* Tab. */
+@@ -1801,7 +1801,7 @@ vte_sequence_handler_tab (VteTerminal *terminal, GValueArray *params)
+ long old_len, newcol, col;
+
+ /* Calculate which column is the next tab stop. */
+- newcol = col = terminal->pvt->cursor.col;
++ newcol = col = terminal->pvt->screen->cursor.col;
+
+ g_assert (col >= 0);
+
+@@ -1873,10 +1873,10 @@ vte_sequence_handler_tab (VteTerminal *terminal, GValueArray *params)
+ }
+
+ _vte_invalidate_cells (terminal,
+- terminal->pvt->cursor.col,
+- newcol - terminal->pvt->cursor.col,
+- terminal->pvt->cursor.row, 1);
+- terminal->pvt->cursor.col = newcol;
++ terminal->pvt->screen->cursor.col,
++ newcol - terminal->pvt->screen->cursor.col,
++ terminal->pvt->screen->cursor.row, 1);
++ terminal->pvt->screen->cursor.col = newcol;
+ }
+ }
+
+@@ -1901,7 +1901,7 @@ vte_sequence_handler_tab_clear (VteTerminal *terminal, GValueArray *params)
+ }
+ if (param == 0) {
+ _vte_terminal_clear_tabstop(terminal,
+- terminal->pvt->cursor.col);
++ terminal->pvt->screen->cursor.col);
+ } else
+ if (param == 3) {
+ if (terminal->pvt->tabstops != NULL) {
+@@ -1939,7 +1939,7 @@ vte_sequence_handler_cursor_up (VteTerminal *terminal, GValueArray *params)
+ }
+ }
+
+- terminal->pvt->cursor.row = MAX(terminal->pvt->cursor.row - val, start);
++ screen->cursor.row = MAX(screen->cursor.row - val, start);
+ }
+
+ /* Vertical tab. */
+@@ -2593,7 +2593,7 @@ vte_sequence_handler_insert_lines (VteTerminal *terminal, GValueArray *params)
+ }
+ }
+ /* Find the region we're messing with. */
+- row = terminal->pvt->cursor.row;
++ row = screen->cursor.row;
+ if (terminal->pvt->scrolling_restricted) {
+ end = screen->insert_delta + terminal->pvt->scrolling_region.end;
+ } else {
+@@ -2612,7 +2612,7 @@ vte_sequence_handler_insert_lines (VteTerminal *terminal, GValueArray *params)
+ _vte_terminal_ring_remove (terminal, end);
+ _vte_terminal_ring_insert (terminal, row, TRUE);
+ }
+- terminal->pvt->cursor.col = 0;
++ screen->cursor.col = 0;
+ /* Update the display. */
+ _vte_terminal_scroll_region(terminal, row, end - row + 1, param);
+ /* Adjust the scrollbars if necessary. */
+@@ -2640,7 +2640,7 @@ vte_sequence_handler_delete_lines (VteTerminal *terminal, GValueArray *params)
+ }
+ }
+ /* Find the region we're messing with. */
+- row = terminal->pvt->cursor.row;
++ row = screen->cursor.row;
+ if (terminal->pvt->scrolling_restricted) {
+ end = screen->insert_delta + terminal->pvt->scrolling_region.end;
+ } else {
+@@ -2660,7 +2660,7 @@ vte_sequence_handler_delete_lines (VteTerminal *terminal, GValueArray *params)
+ _vte_terminal_ring_remove (terminal, row);
+ _vte_terminal_ring_insert (terminal, end, TRUE);
+ }
+- terminal->pvt->cursor.col = 0;
++ screen->cursor.col = 0;
+ /* Update the display. */
+ _vte_terminal_scroll_region(terminal, row, end - row + 1, -param);
+ /* Adjust the scrollbars if necessary. */
+@@ -2700,12 +2700,12 @@ vte_sequence_handler_device_status_report (VteTerminal *terminal, GValueArray *p
+ origin = 0;
+ rowmax = terminal->pvt->row_count - 1;
+ }
+- rowval = terminal->pvt->cursor.row - screen->insert_delta - origin;
++ rowval = screen->cursor.row - screen->insert_delta - origin;
+ rowval = CLAMP(rowval, 0, rowmax);
+ g_snprintf(buf, sizeof(buf),
+ _VTE_CAP_CSI "%ld;%ldR",
+ rowval + 1,
+- CLAMP(terminal->pvt->cursor.col + 1,
++ CLAMP(screen->cursor.col + 1,
+ 1, terminal->pvt->column_count));
+ vte_terminal_feed_child(terminal, buf, -1);
+ break;
+@@ -2742,12 +2742,12 @@ vte_sequence_handler_dec_device_status_report (VteTerminal *terminal, GValueArra
+ origin = 0;
+ rowmax = terminal->pvt->row_count - 1;
+ }
+- rowval = terminal->pvt->cursor.row - screen->insert_delta - origin;
++ rowval = screen->cursor.row - screen->insert_delta - origin;
+ rowval = CLAMP(rowval, 0, rowmax);
+ g_snprintf(buf, sizeof(buf),
+ _VTE_CAP_CSI "?%ld;%ldR",
+ rowval + 1,
+- CLAMP(terminal->pvt->cursor.col + 1,
++ CLAMP(screen->cursor.col + 1,
+ 1, terminal->pvt->column_count));
+ vte_terminal_feed_child(terminal, buf, -1);
+ break;
+--
+2.5.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 352780d8363a..ab1675929fe2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,31 +4,34 @@
pkgbase=vte3-notification
pkgname=(vte3-notification vte-notification-common)
-pkgver=0.42.1
+pkgver=0.42.3
pkgrel=1
pkgdesc='Virtual Terminal Emulator widget for use with GTK3'
arch=('i686' 'x86_64')
license=('LGPL')
options=('!emptydirs')
-makedepends=('intltool' 'gobject-introspection' 'gtk3' 'vala' 'gperf')
+makedepends=('intltool' 'gobject-introspection' 'gtk3' 'vala' 'gperf' 'glade')
url='https://www.gnome.org'
source=(
"https://download.gnome.org/sources/vte/${pkgver::4}/vte-${pkgver}.tar.xz"
'0001-widget-Only-show-the-cursor-on-motion-if-moved.patch'
- 'add-zsh-notfication-support.patch'
+ '0001-emulation-Track-the-cursor-separately-for-the-two-sc.patch'
'vte291-command-notify.patch'
+ 'add-zsh-notfication-support.patch'
)
sha256sums=(
- '9e00e2e9e94f4202b979c871f407a8815890bc0f4a8448a08534f76ab0fc9d34'
+ '96e98a40eae82d04c08f2ca1d2672659596e5b75626ba7d78df2412878ae62a0'
'4379593bdddbe7ebcf6efd808f6334ce86334426d07f7ad777a3aa2d1ee2c50d'
+ '2a3a37001077f271fa252b1ed3cf21c7fc2f046dbcc46df52f61aebf5284b19c'
+ 'f6eb91bdd27f29560e767b529c4e08d7fccf7ceae78fb45a44a511fde55c9a32'
'150a151404ca565f70259044661b2ef5cda43142ca677e7da324614eef8cf45a'
- 'd7dce79b0950b35052f60cacc7ce835a6111a4f3e833a5406590ff141fb41825'
)
prepare () {
cd "vte-${pkgver}"
patch -p1 -i '../0001-widget-Only-show-the-cursor-on-motion-if-moved.patch'
+ patch -p1 -i '../0001-emulation-Track-the-cursor-separately-for-the-two-sc.patch'
patch -p1 -i '../vte291-command-notify.patch'
patch -p1 -i '../add-zsh-notfication-support.patch'
}
@@ -38,7 +41,8 @@ build() {
./configure --prefix=/usr --sysconfdir=/etc \
--libexecdir=/usr/lib/vte \
--localstatedir=/var --disable-static \
- --enable-introspection
+ --enable-introspection --enable-glade-catalogue
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' -e 's/ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then/ func_append compile_command " -Wl,-O1,--as-needed"\n func_append finalize_command " -Wl,-O1,--as-needed"\n\0/' libtool
make
}
diff --git a/vte291-command-notify.patch b/vte291-command-notify.patch
index 70aa402a968a..4b3c195d91b7 100644
--- a/vte291-command-notify.patch
+++ b/vte291-command-notify.patch
@@ -1,4 +1,4 @@
-From fec7cd86ca4fe43d64f51af873fa9f81b6c7cf9f Mon Sep 17 00:00:00 2001
+From ae33abe3ab357de1dc341841c435d7e3cd4fca8b Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Wed, 7 Jan 2015 16:01:00 +0100
Subject: [PATCH 1/3] emulation: Add sequences and signals for desktop
@@ -60,10 +60,10 @@ index 0276422ec6d4..2c35c685930a 100644
VOID:STRING,UINT
VOID:UINT,UINT
diff --git a/src/vte.cc b/src/vte.cc
-index 5b70bd1bfa77..55e57dd3270a 100644
+index 701891ba93b3..7830319ea9a3 100644
--- a/src/vte.cc
+++ b/src/vte.cc
-@@ -8898,6 +8898,9 @@ vte_terminal_finalize(GObject *object)
+@@ -8906,6 +8906,9 @@ vte_terminal_finalize(GObject *object)
remove_update_timeout (terminal);
@@ -73,7 +73,7 @@ index 5b70bd1bfa77..55e57dd3270a 100644
/* discard title updates */
g_free(terminal->pvt->window_title);
g_free(terminal->pvt->window_title_changed);
-@@ -10630,6 +10633,7 @@ vte_terminal_class_init(VteTerminalClass *klass)
+@@ -10638,6 +10641,7 @@ vte_terminal_class_init(VteTerminalClass *klass)
klass->child_exited = NULL;
klass->encoding_changed = NULL;
klass->char_size_changed = NULL;
@@ -81,7 +81,7 @@ index 5b70bd1bfa77..55e57dd3270a 100644
klass->window_title_changed = NULL;
klass->icon_title_changed = NULL;
klass->selection_changed = NULL;
-@@ -10704,6 +10708,25 @@ vte_terminal_class_init(VteTerminalClass *klass)
+@@ -10712,6 +10716,25 @@ vte_terminal_class_init(VteTerminalClass *klass)
1, G_TYPE_INT);
/**
@@ -107,7 +107,7 @@ index 5b70bd1bfa77..55e57dd3270a 100644
* VteTerminal::window-title-changed:
* @vteterminal: the object which received the signal
*
-@@ -12720,6 +12743,16 @@ need_processing (VteTerminal *terminal)
+@@ -12732,6 +12755,16 @@ need_processing (VteTerminal *terminal)
return _vte_incoming_chunks_length (terminal->pvt->incoming) != 0;
}
@@ -124,7 +124,7 @@ index 5b70bd1bfa77..55e57dd3270a 100644
/* Emit an "icon-title-changed" signal. */
static void
vte_terminal_emit_icon_title_changed(VteTerminal *terminal)
-@@ -12767,6 +12800,11 @@ vte_terminal_emit_pending_signals(VteTerminal *terminal)
+@@ -12779,6 +12812,11 @@ vte_terminal_emit_pending_signals(VteTerminal *terminal)
vte_terminal_emit_adjustment_changed (terminal);
@@ -158,10 +158,10 @@ index dbe3ffed81ba..8b21635bea9e 100644
VteTerminalClassPrivate *priv;
};
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
-index 4eeeddbc2e1f..b8575d02c99e 100644
+index f2152e6a8853..8c4c87d73122 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
-@@ -367,6 +367,11 @@ public:
+@@ -369,6 +369,11 @@ public:
gboolean cursor_moved_pending;
gboolean contents_changed_pending;
@@ -183,10 +183,10 @@ index ad5b6d99f938..287caa5b5928 100644
"set-current-file-uri", VTE_SEQUENCE_HANDLER(vte_sequence_handler_set_current_file_uri)
+"send-notification", VTE_SEQUENCE_HANDLER(vte_sequence_handler_send_notification)
diff --git a/src/vteseq.cc b/src/vteseq.cc
-index ffb00f689a0a..ec9370c7c37d 100644
+index bf76995165bb..59f091f166aa 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
-@@ -2227,6 +2227,96 @@ vte_sequence_handler_return_terminal_id (VteTerminal *terminal, GValueArray *par
+@@ -2243,6 +2243,96 @@ vte_sequence_handler_return_terminal_id (VteTerminal *terminal, GValueArray *par
vte_sequence_handler_send_primary_device_attributes (terminal, params);
}
@@ -284,10 +284,10 @@ index ffb00f689a0a..ec9370c7c37d 100644
static void
vte_sequence_handler_send_secondary_device_attributes (VteTerminal *terminal, GValueArray *params)
--
-2.1.0
+2.5.0
-From 930f9e8252175ed3ca94f12af3d6c271637da947 Mon Sep 17 00:00:00 2001
+From d781b9be57a7d612558241a1712d1ad28c56de44 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 29 Jan 2015 13:09:17 +0100
Subject: [PATCH 2/3] vte.sh: Emit OSC 777 from PROMPT_COMMAND
@@ -315,10 +315,10 @@ index 2d211caa2f17..1c0543bd9d26 100644
case "$TERM" in
--
-2.1.0
+2.5.0
-From 2b2ad252df1add231616f5024cdc572ef587771c Mon Sep 17 00:00:00 2001
+From 21df58de64837af0216926743fbb9b3a10f82dfc Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 22 Jan 2015 16:37:10 +0100
Subject: [PATCH 3/3] vteapp: Add a test for the notification-received signal
@@ -328,7 +328,7 @@ Subject: [PATCH 3/3] vteapp: Add a test for the notification-received signal
1 file changed, 7 insertions(+)
diff --git a/src/app.vala b/src/app.vala
-index e102e4618d81..cc2248009232 100644
+index aa8d312abbca..290657d9495d 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -102,6 +102,8 @@ class Window : Gtk.ApplicationWindow
@@ -353,5 +353,5 @@ index e102e4618d81..cc2248009232 100644
class App : Gtk.Application
--
-2.1.0
+2.5.0