summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2020-12-26 14:01:10 +0100
committerChristian Persch <chpe@src.gnome.org>2020-12-26 14:01:10 +0100
commitcaf8a6a7a17a3f70fa5fc611c71ffb27a5cfee75 (patch)
treeeb6dea8590ff652f1c2a2e9a6f1f151cea4aa71b
parentd4e0d89c6c782f380abf293a822eb7993d588067 (diff)
downloadvte-caf8a6a7a17a3f70fa5fc611c71ffb27a5cfee75.tar.gz
widget: Limit select-all to the writable region not including the scrollback
Including the scrollback in select-all makes it too easy to select so much data that putting it on the clipboard either hangs the process for a long time or causes a crash (gnome-terminal#288). Fixes: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/288
-rw-r--r--src/vte.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/vte.cc b/src/vte.cc
index d813e16c..c7ee93ab 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -6672,7 +6672,10 @@ Terminal::maybe_end_selection()
/*
* Terminal::select_all:
*
- * Selects all text within the terminal (including the scrollback buffer).
+ * Selects all text within the terminal. Note that we only select the writable
+ * region, *not* the scrollback buffer, due to this potentially selecting so
+ * much data that putting it on the clipboard either hangs the process for a long
+ * time or even crash it directly. (FIXME!)
*/
void
Terminal::select_all()
@@ -6681,8 +6684,8 @@ Terminal::select_all()
m_selecting_had_delta = TRUE;
- m_selection_resolved.set ({ _vte_ring_delta (m_screen->row_data), 0 },
- { _vte_ring_next (m_screen->row_data), 0 });
+ m_selection_resolved.set({m_screen->insert_delta, 0},
+ {_vte_ring_next(m_screen->row_data), 0});
_vte_debug_print(VTE_DEBUG_SELECTION, "Selecting *all* text.\n");