Blame SOURCES/vte291-cntnr-precmd-preexec-scroll.patch

0658e0
From b0b746ddf50375173d0b98baf12740dc910745d2 Mon Sep 17 00:00:00 2001
0658e0
From: Debarshi Ray <debarshir@gnome.org>
0658e0
Date: Wed, 7 Jan 2015 16:01:00 +0100
0658e0
Subject: [PATCH 01/11] Add sequences and signals for desktop notification
0658e0
0658e0
Add sequences
0658e0
  OSC 777 ; notify ; SUMMARY ; BODY BEL
0658e0
  OSC 777 ; notify ; SUMMARY BEL
0658e0
  OSC 777 ; notify ; SUMMARY ; BODY ST
0658e0
  OSC 777 ; notify ; SUMMARY ST
0658e0
0658e0
that let terminal applications send a notification to the desktop
0658e0
environment.
0658e0
0658e0
Based on Enlightenment's Terminology:
0658e0
https://phab.enlightenment.org/T1765
0658e0
0658e0
https://bugzilla.gnome.org/show_bug.cgi?id=711059
0658e0
---
0658e0
 src/marshal.list      |  1 +
0658e0
 src/vte.cc            |  8 ++++++++
0658e0
 src/vte/vteterminal.h |  4 +++-
0658e0
 src/vtegtk.cc         | 21 +++++++++++++++++++++
0658e0
 src/vtegtk.hh         |  1 +
0658e0
 src/vteinternal.hh    |  8 ++++++++
0658e0
 src/vteseq.cc         | 32 +++++++++++++++++++++++++++++++-
0658e0
 7 files changed, 73 insertions(+), 2 deletions(-)
0658e0
0658e0
diff --git a/src/marshal.list b/src/marshal.list
0658e0
index 241128c3ccfe..4412cf3d5f5c 100644
0658e0
--- a/src/marshal.list
0658e0
+++ b/src/marshal.list
0658e0
@@ -1,3 +1,4 @@
0658e0
 VOID:STRING,BOXED
0658e0
+VOID:STRING,STRING
0658e0
 VOID:STRING,UINT
0658e0
 VOID:UINT,UINT
0658e0
diff --git a/src/vte.cc b/src/vte.cc
0658e0
index 4ea466bd9360..033abcfe83cb 100644
0658e0
--- a/src/vte.cc
0658e0
+++ b/src/vte.cc
0658e0
@@ -10100,6 +10100,14 @@ Terminal::emit_pending_signals()
0658e0
 
0658e0
 	emit_adjustment_changed();
0658e0
 
0658e0
+        if (m_pending_changes & vte::to_integral(PendingChanges::NOTIFICATION)) {
0658e0
+                _vte_debug_print (VTE_DEBUG_SIGNALS,
0658e0
+                                  "Emitting `notification-received'.\n");
0658e0
+                g_signal_emit(freezer.get(), signals[SIGNAL_NOTIFICATION_RECEIVED], 0,
0658e0
+                              m_notification_summary.c_str(),
0658e0
+                              m_notification_body.c_str());
0658e0
+        }
0658e0
+
0658e0
 	if (m_pending_changes & vte::to_integral(PendingChanges::TITLE)) {
0658e0
                 if (m_window_title != m_window_title_pending) {
0658e0
                         m_window_title.swap(m_window_title_pending);
0658e0
diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
0658e0
index e705ece69ad6..668a7dbeae96 100644
0658e0
--- a/src/vte/vteterminal.h
0658e0
+++ b/src/vte/vteterminal.h
0658e0
@@ -102,8 +102,10 @@ struct _VteTerminalClass {
0658e0
 
0658e0
 	void (*bell)(VteTerminal* terminal);
0658e0
 
0658e0
+	void (*notification_received)(VteTerminal* terminal, const gchar *summary, const gchar *body);
0658e0
+
0658e0
         /* Padding for future expansion. */
0658e0
-        gpointer padding[16];
0658e0
+        gpointer padding[15];
0658e0
 
0658e0
         VteTerminalClassPrivate *priv;
0658e0
 };
0658e0
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
0658e0
index c68a0f1ac388..e3274ff3df90 100644
0658e0
--- a/src/vtegtk.cc
0658e0
+++ b/src/vtegtk.cc
0658e0
@@ -983,6 +983,7 @@ vte_terminal_class_init(VteTerminalClass *klass)
0658e0
 	klass->child_exited = NULL;
0658e0
 	klass->encoding_changed = NULL;
0658e0
 	klass->char_size_changed = NULL;
0658e0
+	klass->notification_received = NULL;
0658e0
 	klass->window_title_changed = NULL;
0658e0
 	klass->icon_title_changed = NULL;
0658e0
 	klass->selection_changed = NULL;
0658e0
@@ -1064,6 +1065,26 @@ vte_terminal_class_init(VteTerminalClass *klass)
0658e0
                                    G_OBJECT_CLASS_TYPE(klass),
0658e0
                                    g_cclosure_marshal_VOID__INTv);
0658e0
 
0658e0
+        /**
0658e0
+         * VteTerminal::notification-received:
0658e0
+         * @vteterminal: the object which received the signal
0658e0
+         * @summary: The summary
0658e0
+         * @body: (allow-none): Extra optional text
0658e0
+         *
0658e0
+         * Emitted when a process running in the terminal wants to
0658e0
+         * send a notification to the desktop environment.
0658e0
+         */
0658e0
+        signals[SIGNAL_NOTIFICATION_RECEIVED] =
0658e0
+                g_signal_new(I_("notification-received"),
0658e0
+                             G_OBJECT_CLASS_TYPE(klass),
0658e0
+                             G_SIGNAL_RUN_LAST,
0658e0
+                             G_STRUCT_OFFSET(VteTerminalClass, notification_received),
0658e0
+                             NULL,
0658e0
+                             NULL,
0658e0
+                             _vte_marshal_VOID__STRING_STRING,
0658e0
+                             G_TYPE_NONE,
0658e0
+                             2, G_TYPE_STRING, G_TYPE_STRING);
0658e0
+
0658e0
         /**
0658e0
          * VteTerminal::window-title-changed:
0658e0
          * @vteterminal: the object which received the signal
0658e0
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
0658e0
index 1cb8cb49967b..389b86d2e557 100644
0658e0
--- a/src/vtegtk.hh
0658e0
+++ b/src/vtegtk.hh
0658e0
@@ -56,6 +56,7 @@ enum {
0658e0
         SIGNAL_TEXT_INSERTED,
0658e0
         SIGNAL_TEXT_MODIFIED,
0658e0
         SIGNAL_TEXT_SCROLLED,
0658e0
+        SIGNAL_NOTIFICATION_RECEIVED,
0658e0
         SIGNAL_WINDOW_TITLE_CHANGED,
0658e0
         LAST_SIGNAL
0658e0
 };
0658e0
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
0658e0
index 7a257afed861..38aaf421ec30 100644
0658e0
--- a/src/vteinternal.hh
0658e0
+++ b/src/vteinternal.hh
0658e0
@@ -621,6 +621,10 @@ public:
0658e0
         gboolean m_cursor_moved_pending;
0658e0
         gboolean m_contents_changed_pending;
0658e0
 
0658e0
+        /* desktop notification */
0658e0
+        std::string m_notification_summary;
0658e0
+        std::string m_notification_body;
0658e0
+
0658e0
         std::string m_window_title{};
0658e0
         std::string m_current_directory_uri{};
0658e0
         std::string m_current_file_uri{};
0658e0
@@ -634,6 +638,7 @@ public:
0658e0
                 TITLE = 1u << 0,
0658e0
                 CWD   = 1u << 1,
0658e0
                 CWF   = 1u << 2,
0658e0
+                NOTIFICATION = 1u << 3,
0658e0
         };
0658e0
         unsigned m_pending_changes{0};
0658e0
 
0658e0
@@ -1358,6 +1363,9 @@ public:
0658e0
                              int osc) noexcept;
0658e0
 
0658e0
         /* OSC handlers */
0658e0
+        void handle_urxvt_extension(vte::parser::Sequence const& seq,
0658e0
+                                    vte::parser::StringTokeniser::const_iterator& token,
0658e0
+                                    vte::parser::StringTokeniser::const_iterator const& endtoken) noexcept;
0658e0
         void set_color(vte::parser::Sequence const& seq,
0658e0
                        vte::parser::StringTokeniser::const_iterator& token,
0658e0
                        vte::parser::StringTokeniser::const_iterator const& endtoken,
0658e0
diff --git a/src/vteseq.cc b/src/vteseq.cc
0658e0
index bde2fa7ba0ab..7ab65b6d204a 100644
0658e0
--- a/src/vteseq.cc
0658e0
+++ b/src/vteseq.cc
0658e0
@@ -1377,6 +1377,33 @@ Terminal::delete_lines(vte::grid::row_t param)
0658e0
         m_text_deleted_flag = TRUE;
0658e0
 }
0658e0
 
0658e0
+void
0658e0
+Terminal::handle_urxvt_extension(vte::parser::Sequence const& seq,
0658e0
+                                 vte::parser::StringTokeniser::const_iterator& token,
0658e0
+                                 vte::parser::StringTokeniser::const_iterator const& endtoken) noexcept
0658e0
+{
0658e0
+        if (token == endtoken)
0658e0
+                return;
0658e0
+
0658e0
+        if (*token == "notify") {
0658e0
+                ++token;
0658e0
+
0658e0
+                if (token == endtoken)
0658e0
+                        return;
0658e0
+
0658e0
+                m_notification_summary = *token;
0658e0
+                m_notification_body.clear();
0658e0
+                m_pending_changes |= vte::to_integral(PendingChanges::NOTIFICATION);
0658e0
+                ++token;
0658e0
+
0658e0
+                if (token == endtoken)
0658e0
+                        return;
0658e0
+
0658e0
+                m_notification_body = *token;
0658e0
+                return;
0658e0
+        }
0658e0
+}
0658e0
+
0658e0
 bool
0658e0
 Terminal::get_osc_color_index(int osc,
0658e0
                                         int value,
0658e0
@@ -6519,6 +6546,10 @@ Terminal::OSC(vte::parser::Sequence const& seq)
0658e0
                 reset_color(VTE_HIGHLIGHT_FG, VTE_COLOR_SOURCE_ESCAPE);
0658e0
                 break;
0658e0
 
0658e0
+        case VTE_OSC_URXVT_EXTENSION:
0658e0
+                handle_urxvt_extension(seq, it, cend);
0658e0
+                break;
0658e0
+
0658e0
         case VTE_OSC_XTERM_SET_ICON_TITLE:
0658e0
         case VTE_OSC_XTERM_SET_XPROPERTY:
0658e0
         case VTE_OSC_XTERM_SET_COLOR_MOUSE_CURSOR_FG:
0658e0
@@ -6559,7 +6590,6 @@ Terminal::OSC(vte::parser::Sequence const& seq)
0658e0
         case VTE_OSC_URXVT_SET_FONT_BOLD_ITALIC:
0658e0
         case VTE_OSC_URXVT_VIEW_UP:
0658e0
         case VTE_OSC_URXVT_VIEW_DOWN:
0658e0
-        case VTE_OSC_URXVT_EXTENSION:
0658e0
         case VTE_OSC_YF_RQGWR:
0658e0
         default:
0658e0
                 break;
0658e0
-- 
0658e0
2.31.1
0658e0
0658e0
0658e0
From f1ba75377276560079af1d8f615380abd5fc9438 Mon Sep 17 00:00:00 2001
0658e0
From: Debarshi Ray <debarshir@gnome.org>
0658e0
Date: Thu, 29 Jan 2015 13:09:17 +0100
0658e0
Subject: [PATCH 02/11] vte.sh: Emit OSC 777 from PROMPT_COMMAND
0658e0
0658e0
For some reason, the three consecutive backslashes break the parsing.
0658e0
As Christian Persch suggested, replacing the double quotes with
0658e0
singles fixes it.
0658e0
0658e0
https://bugzilla.gnome.org/show_bug.cgi?id=711059
0658e0
---
0658e0
 src/vte.sh.in | 4 +++-
0658e0
 1 file changed, 3 insertions(+), 1 deletion(-)
0658e0
0658e0
diff --git a/src/vte.sh.in b/src/vte.sh.in
0658e0
index 3ac99d7ec04f..2c6f668142c3 100644
0658e0
--- a/src/vte.sh.in
0658e0
+++ b/src/vte.sh.in
0658e0
@@ -27,10 +27,12 @@ __vte_osc7 () {
0658e0
 }
0658e0
 
0658e0
 __vte_prompt_command() {
0658e0
+  local command=$(HISTTIMEFORMAT= history 1 | sed 's/^ *[0-9]\+ *//')
0658e0
+  command="${command//;/ }"
0658e0
   local pwd='~'
0658e0
   [ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/}
0658e0
   pwd="${pwd//[[:cntrl:]]}"
0658e0
-  printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${pwd}"
0658e0
+  printf '\033]777;notify;Command completed;%s\033\\\033]0;%s@%s:%s\033\\' "${command}" "${USER}" "${HOSTNAME%%.*}" "${pwd}"
0658e0
   __vte_osc7
0658e0
 }
0658e0
 
0658e0
-- 
0658e0
2.31.1
0658e0
0658e0
0658e0
From 5c825104d44100b72d98cf02ea0751065576af4e Mon Sep 17 00:00:00 2001
0658e0
From: Debarshi Ray <debarshir@gnome.org>
0658e0
Date: Thu, 22 Jan 2015 16:37:10 +0100
0658e0
Subject: [PATCH 03/11] Test the notification-received signal
0658e0
0658e0
---
0658e0
 bindings/vala/app.vala |  7 +++++++
0658e0
 src/app/app.cc         | 10 ++++++++++
0658e0
 2 files changed, 17 insertions(+)
0658e0
0658e0
diff --git a/bindings/vala/app.vala b/bindings/vala/app.vala
0658e0
index 8ab27e5aaf9a..025f971b2eb0 100644
0658e0
--- a/bindings/vala/app.vala
0658e0
+++ b/bindings/vala/app.vala
0658e0
@@ -309,6 +309,8 @@ class Window : Gtk.ApplicationWindow
0658e0
     if (Options.object_notifications)
0658e0
       terminal.notify.connect(notify_cb);
0658e0
 
0658e0
+    terminal.notification_received.connect(notification_received_cb);
0658e0
+
0658e0
     /* Settings */
0658e0
     if (Options.no_double_buffer)
0658e0
       terminal.set_double_buffered(false);
0658e0
@@ -780,6 +782,11 @@ class Window : Gtk.ApplicationWindow
0658e0
     set_title(terminal.get_window_title());
0658e0
   }
0658e0
 
0658e0
+  private void notification_received_cb(Vte.Terminal terminal, string summary, string? body)
0658e0
+  {
0658e0
+    print ("[%s]: %s\n", summary, body);
0658e0
+  }
0658e0
+
0658e0
 } /* class Window */
0658e0
 
0658e0
 class App : Gtk.Application
0658e0
diff --git a/src/app/app.cc b/src/app/app.cc
0658e0
index 37d51c6b8963..73810251a4d0 100644
0658e0
--- a/src/app/app.cc
0658e0
+++ b/src/app/app.cc
0658e0
@@ -1877,6 +1877,14 @@ window_window_title_changed_cb(VteTerminal* terminal,
0658e0
                              vte_terminal_get_window_title(window->terminal));
0658e0
 }
0658e0
 
0658e0
+static void
0658e0
+notification_received_cb(VteTerminal *terminal,
0658e0
+                         const gchar *summary,
0658e0
+                         const gchar *body)
0658e0
+{
0658e0
+        g_print("[%s]: %s\n", summary, body);
0658e0
+}
0658e0
+
0658e0
 static void
0658e0
 window_lower_window_cb(VteTerminal* terminal,
0658e0
                        VteappWindow* window)
0658e0
@@ -2115,6 +2123,8 @@ vteapp_window_constructed(GObject *object)
0658e0
         if (options.object_notifications)
0658e0
                 g_signal_connect(window->terminal, "notify", G_CALLBACK(window_notify_cb), window);
0658e0
 
0658e0
+        g_signal_connect(window->terminal, "notification-received", G_CALLBACK(notification_received_cb), NULL);
0658e0
+
0658e0
         /* Settings */
0658e0
         if (options.no_double_buffer) {
0658e0
                 G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
0658e0
-- 
0658e0
2.31.1
0658e0
0658e0
0658e0
From aa647920fe6dc8ee0f4d23d8d90bafc649d01efe Mon Sep 17 00:00:00 2001
0658e0
From: Debarshi Ray <debarshir@gnome.org>
0658e0
Date: Fri, 13 May 2016 17:53:54 +0200
0658e0
Subject: [PATCH 04/11] Add a property to configure the scroll speed
0658e0
0658e0
By default, it is set to zero which gives the current behaviour of
0658e0
moving the buffer by a function of the number of visible rows.
0658e0
0658e0
https://bugzilla.redhat.com/show_bug.cgi?id=1103380
0658e0
---
0658e0
 doc/reference/vte-sections.txt |  1 +
0658e0
 src/vte.cc                     | 19 ++++++++++++-
0658e0
 src/vte/vteterminal.h          |  4 +++
0658e0
 src/vtegtk.cc                  | 51 ++++++++++++++++++++++++++++++++++
0658e0
 src/vtegtk.hh                  |  1 +
0658e0
 src/vteinternal.hh             |  2 ++
0658e0
 6 files changed, 77 insertions(+), 1 deletion(-)
0658e0
0658e0
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
0658e0
index c69181da7c78..dba88c156fe8 100644
0658e0
--- a/doc/reference/vte-sections.txt
0658e0
+++ b/doc/reference/vte-sections.txt
0658e0
@@ -54,6 +54,7 @@ vte_terminal_get_cursor_blink_mode
0658e0
 vte_terminal_set_cursor_blink_mode
0658e0
 vte_terminal_get_text_blink_mode
0658e0
 vte_terminal_set_text_blink_mode
0658e0
+vte_terminal_set_scroll_speed
0658e0
 vte_terminal_set_scrollback_lines
0658e0
 vte_terminal_get_scrollback_lines
0658e0
 vte_terminal_set_font
0658e0
diff --git a/src/vte.cc b/src/vte.cc
0658e0
index 033abcfe83cb..02fe5cbf2df7 100644
0658e0
--- a/src/vte.cc
0658e0
+++ b/src/vte.cc
0658e0
@@ -9293,6 +9293,7 @@ vte_cairo_get_clip_region (cairo_t *cr)
0658e0
 bool
0658e0
 Terminal::widget_mouse_scroll(vte::platform::ScrollEvent const& event)
0658e0
 {
0658e0
+	gdouble scroll_speed;
0658e0
 	gdouble v;
0658e0
 	gint cnt, i;
0658e0
 	int button;
0658e0
@@ -9327,7 +9328,13 @@ Terminal::widget_mouse_scroll(vte::platform::ScrollEvent const& event)
0658e0
 		return true;
0658e0
 	}
0658e0
 
0658e0
-        v = MAX (1., ceil (gtk_adjustment_get_page_increment (m_vadjustment.get()) / 10.));
0658e0
+	if (m_scroll_speed == 0) {
0658e0
+		scroll_speed = ceil (gtk_adjustment_get_page_increment (m_vadjustment.get()) / 10.);
0658e0
+	} else {
0658e0
+		scroll_speed = m_scroll_speed;
0658e0
+	}
0658e0
+
0658e0
+	v = MAX (1., scroll_speed);
0658e0
 	_vte_debug_print(VTE_DEBUG_EVENTS,
0658e0
 			"Scroll speed is %d lines per non-smooth scroll unit\n",
0658e0
 			(int) v);
0658e0
@@ -9641,6 +9648,16 @@ Terminal::decscusr_cursor_shape() const noexcept
0658e0
         }
0658e0
 }
0658e0
 
0658e0
+bool
0658e0
+Terminal::set_scroll_speed(unsigned int scroll_speed)
0658e0
+{
0658e0
+        if (scroll_speed == m_scroll_speed)
0658e0
+                return false;
0658e0
+
0658e0
+        m_scroll_speed = scroll_speed;
0658e0
+        return true;
0658e0
+}
0658e0
+
0658e0
 bool
0658e0
 Terminal::set_scrollback_lines(long lines)
0658e0
 {
0658e0
diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
0658e0
index 668a7dbeae96..0143f0b9dd4d 100644
0658e0
--- a/src/vte/vteterminal.h
0658e0
+++ b/src/vte/vteterminal.h
0658e0
@@ -310,6 +310,10 @@ void vte_terminal_set_cursor_shape(VteTerminal *terminal,
0658e0
 _VTE_PUBLIC
0658e0
 VteCursorShape vte_terminal_get_cursor_shape(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
0658e0
 
0658e0
+_VTE_PUBLIC
0658e0
+void vte_terminal_set_scroll_speed(VteTerminal *terminal,
0658e0
+                                   guint scroll_speed) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
0658e0
+
0658e0
 /* Set the number of scrollback lines, above or at an internal minimum. */
0658e0
 _VTE_PUBLIC
0658e0
 void vte_terminal_set_scrollback_lines(VteTerminal *terminal,
0658e0
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
0658e0
index e3274ff3df90..b4bcd3d9a1d5 100644
0658e0
--- a/src/vtegtk.cc
0658e0
+++ b/src/vtegtk.cc
0658e0
@@ -758,6 +758,9 @@ try
0658e0
                 case PROP_REWRAP_ON_RESIZE:
0658e0
                         g_value_set_boolean (value, vte_terminal_get_rewrap_on_resize (terminal));
0658e0
                         break;
0658e0
+                case PROP_SCROLL_SPEED:
0658e0
+                        g_value_set_uint (value, impl->m_scroll_speed);
0658e0
+                        break;
0658e0
                 case PROP_SCROLLBACK_LINES:
0658e0
                         g_value_set_uint (value, vte_terminal_get_scrollback_lines(terminal));
0658e0
                         break;
0658e0
@@ -876,6 +879,9 @@ try
0658e0
                 case PROP_REWRAP_ON_RESIZE:
0658e0
                         vte_terminal_set_rewrap_on_resize (terminal, g_value_get_boolean (value));
0658e0
                         break;
0658e0
+                case PROP_SCROLL_SPEED:
0658e0
+                        vte_terminal_set_scroll_speed (terminal, g_value_get_uint (value));
0658e0
+                        break;
0658e0
                 case PROP_SCROLLBACK_LINES:
0658e0
                         vte_terminal_set_scrollback_lines (terminal, g_value_get_uint (value));
0658e0
                         break;
0658e0
@@ -1966,6 +1972,21 @@ vte_terminal_class_init(VteTerminalClass *klass)
0658e0
                                       TRUE,
0658e0
                                       (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
0658e0
 
0658e0
+        /**
0658e0
+         * VteTerminal:scroll-speed:
0658e0
+         *
0658e0
+         * The number of lines by which the buffer is moved when
0658e0
+         * scrolling with a mouse wheel on top of the terminal
0658e0
+         * Setting it to zero will cause the buffer to be moved by an
0658e0
+         * amount depending on the number of visible rows the widget
0658e0
+         * can display.
0658e0
+         */
0658e0
+        pspecs[PROP_SCROLL_SPEED] =
0658e0
+                g_param_spec_uint ("scroll-speed", NULL, NULL,
0658e0
+                                   0, G_MAXUINT,
0658e0
+                                   0,
0658e0
+                                   (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
0658e0
+
0658e0
         /**
0658e0
          * VteTerminal:scrollback-lines:
0658e0
          *
0658e0
@@ -5367,6 +5388,36 @@ catch (...)
0658e0
         return -1;
0658e0
 }
0658e0
 
0658e0
+/**
0658e0
+ * vte_terminal_set_scroll_speed:
0658e0
+ * @terminal: a #VteTerminal
0658e0
+ * @scroll_speed: move the buffer by this number of lines while scrolling
0658e0
+ *
0658e0
+ * Sets the number of lines by which the buffer is moved when
0658e0
+ * scrolling with a mouse wheel. Setting it to zero will cause the
0658e0
+ * buffer to be moved by an amount depending on the number of visible
0658e0
+ * rows the widget can display.
0658e0
+ */
0658e0
+void
0658e0
+vte_terminal_set_scroll_speed(VteTerminal *terminal,
0658e0
+                              guint scroll_speed) noexcept
0658e0
+try
0658e0
+{
0658e0
+        g_return_if_fail(VTE_IS_TERMINAL(terminal));
0658e0
+
0658e0
+        GObject *object = G_OBJECT(terminal);
0658e0
+        g_object_freeze_notify(object);
0658e0
+
0658e0
+        if (IMPL(terminal)->set_scroll_speed(scroll_speed))
0658e0
+                g_object_notify_by_pspec(object, pspecs[PROP_SCROLL_SPEED]);
0658e0
+
0658e0
+        g_object_thaw_notify(object);
0658e0
+}
0658e0
+catch (...)
0658e0
+{
0658e0
+        vte::log_exception();
0658e0
+}
0658e0
+
0658e0
 /**
0658e0
  * vte_terminal_set_scrollback_lines:
0658e0
  * @terminal: a #VteTerminal
0658e0
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
0658e0
index 389b86d2e557..24063c3060da 100644
0658e0
--- a/src/vtegtk.hh
0658e0
+++ b/src/vtegtk.hh
0658e0
@@ -90,6 +90,7 @@ enum {
0658e0
         PROP_MOUSE_POINTER_AUTOHIDE,
0658e0
         PROP_PTY,
0658e0
         PROP_REWRAP_ON_RESIZE,
0658e0
+        PROP_SCROLL_SPEED,
0658e0
         PROP_SCROLLBACK_LINES,
0658e0
         PROP_SCROLL_ON_KEYSTROKE,
0658e0
         PROP_SCROLL_ON_OUTPUT,
0658e0
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
0658e0
index 38aaf421ec30..fd1a8b9008cf 100644
0658e0
--- a/src/vteinternal.hh
0658e0
+++ b/src/vteinternal.hh
0658e0
@@ -399,6 +399,7 @@ public:
0658e0
         bool m_fallback_scrolling{true};
0658e0
         bool m_scroll_on_output{false};
0658e0
         bool m_scroll_on_keystroke{true};
0658e0
+        guint m_scroll_speed;
0658e0
         vte::grid::row_t m_scrollback_lines{0};
0658e0
 
0658e0
         /* Restricted scrolling */
0658e0
@@ -1232,6 +1233,7 @@ public:
0658e0
         bool set_input_enabled(bool enabled);
0658e0
         bool set_mouse_autohide(bool autohide);
0658e0
         bool set_rewrap_on_resize(bool rewrap);
0658e0
+        bool set_scroll_speed(unsigned int scroll_speed);
0658e0
         bool set_scrollback_lines(long lines);
0658e0
         bool set_fallback_scrolling(bool set);
0658e0
         auto fallback_scrolling() const noexcept { return m_fallback_scrolling; }
0658e0
-- 
0658e0
2.31.1
0658e0
0658e0
0658e0
From f080a7417f8f657778916219ad06ab184c53ff9a Mon Sep 17 00:00:00 2001
0658e0
From: Debarshi Ray <debarshir@gnome.org>
0658e0
Date: Fri, 13 May 2016 17:54:57 +0200
0658e0
Subject: [PATCH 05/11] Test the scroll-speed property
0658e0
0658e0
https://bugzilla.redhat.com/show_bug.cgi?id=1103380
0658e0
---
0658e0
 bindings/vala/app.vala | 4 ++++
0658e0
 src/app/app.cc         | 4 ++++
0658e0
 2 files changed, 8 insertions(+)
0658e0
0658e0
diff --git a/bindings/vala/app.vala b/bindings/vala/app.vala
0658e0
index 025f971b2eb0..51b5d6410503 100644
0658e0
--- a/bindings/vala/app.vala
0658e0
+++ b/bindings/vala/app.vala
0658e0
@@ -335,6 +335,7 @@ class Window : Gtk.ApplicationWindow
0658e0
     terminal.set_rewrap_on_resize(!Options.no_rewrap);
0658e0
     terminal.set_scroll_on_output(false);
0658e0
     terminal.set_scroll_on_keystroke(true);
0658e0
+    terminal.set_scroll_speed(Options.scroll_speed);
0658e0
     terminal.set_scrollback_lines(Options.scrollback_lines);
0658e0
 
0658e0
     /* Style */
0658e0
@@ -857,6 +858,7 @@ class App : Gtk.Application
0658e0
     public static bool object_notifications = false;
0658e0
     public static string? output_filename = null;
0658e0
     public static bool reverse = false;
0658e0
+    public static uint scroll_speed = 0;
0658e0
     public static int scrollback_lines = 512;
0658e0
     public static int transparency_percent = 0;
0658e0
     public static bool version = false;
0658e0
@@ -1050,6 +1052,8 @@ class App : Gtk.Application
0658e0
         "Save terminal contents to file at exit", null },
0658e0
       { "reverse", 0, 0, OptionArg.NONE, ref reverse,
0658e0
         "Reverse foreground/background colors", null },
0658e0
+      { "scroll-speed", 0, 0, OptionArg.INT, ref scroll_speed,
0658e0
+        "Specify the scroll speed", null },
0658e0
       { "scrollback-lines", 'n', 0, OptionArg.INT, ref scrollback_lines,
0658e0
         "Specify the number of scrollback-lines", null },
0658e0
       { "transparent", 'T', 0, OptionArg.INT, ref transparency_percent,
0658e0
diff --git a/src/app/app.cc b/src/app/app.cc
0658e0
index 73810251a4d0..90421730a66a 100644
0658e0
--- a/src/app/app.cc
0658e0
+++ b/src/app/app.cc
0658e0
@@ -116,6 +116,7 @@ public:
0658e0
         int verbosity{0};
0658e0
         double cell_height_scale{1.0};
0658e0
         double cell_width_scale{1.0};
0658e0
+        unsigned int scroll_speed{0};
0658e0
         VteCursorBlinkMode cursor_blink_mode{VTE_CURSOR_BLINK_SYSTEM};
0658e0
         VteCursorShape cursor_shape{VTE_CURSOR_SHAPE_BLOCK};
0658e0
         VteTextBlinkMode text_blink_mode{VTE_TEXT_BLINK_ALWAYS};
0658e0
@@ -590,6 +591,8 @@ public:
0658e0
                           "Reverse foreground/background colors", nullptr },
0658e0
                         { "require-systemd-scope", 0, 0, G_OPTION_ARG_NONE, &require_systemd_scope,
0658e0
                           "Require use of a systemd user scope", nullptr },
0658e0
+                        { "scroll-speed", 0, 0, G_OPTION_ARG_INT, &scroll_speed,
0658e0
+                          "Specify the scroll speed", nullptr },
0658e0
                         { "scrollback-lines", 'n', 0, G_OPTION_ARG_INT, &scrollback_lines,
0658e0
                           "Specify the number of scrollback-lines (-1 for infinite)", nullptr },
0658e0
                         { "transparent", 'T', 0, G_OPTION_ARG_INT, &transparency_percent,
0658e0
@@ -2157,6 +2160,7 @@ vteapp_window_constructed(GObject *object)
0658e0
         vte_terminal_set_rewrap_on_resize(window->terminal, !options.no_rewrap);
0658e0
         vte_terminal_set_scroll_on_output(window->terminal, false);
0658e0
         vte_terminal_set_scroll_on_keystroke(window->terminal, true);
0658e0
+        vte_terminal_set_scroll_speed(window->terminal, options.scroll_speed);
0658e0
         vte_terminal_set_scrollback_lines(window->terminal, options.scrollback_lines);
0658e0
         vte_terminal_set_text_blink_mode(window->terminal, options.text_blink_mode);
0658e0
 
0658e0
-- 
0658e0
2.31.1
0658e0
0658e0
0658e0
From b77827bf39fcf7b27f548a5472802371196801d3 Mon Sep 17 00:00:00 2001
0658e0
From: Debarshi Ray <debarshir@gnome.org>
0658e0
Date: Wed, 7 Jan 2015 16:01:00 +0100
0658e0
Subject: [PATCH 06/11] Support preexec notifications from an interactive shell
0658e0
0658e0
Add sequences
0658e0
  OSC 777 ; preexec BEL
0658e0
  OSC 777 ; preexec ST
0658e0
0658e0
that can be used from an interactive shell's preexec hook to notify
0658e0
the terminal emulator that a new command is about to be executed.
0658e0
Examples of such hooks are Bash's PS0 and Zsh's preexec.
0658e0
0658e0
The OSC 777 escape sequence is taken from Enlightenment's Terminology:
0658e0
https://phab.enlightenment.org/T1765
0658e0
0658e0
https://bugzilla.gnome.org/show_bug.cgi?id=711059
0658e0
https://bugzilla.gnome.org/show_bug.cgi?id=711060
0658e0
---
0658e0
 src/vte.cc            |  6 ++++++
0658e0
 src/vte.sh.in         |  2 +-
0658e0
 src/vte/vteterminal.h |  3 ++-
0658e0
 src/vtegtk.cc         | 18 ++++++++++++++++++
0658e0
 src/vtegtk.hh         |  1 +
0658e0
 src/vteinternal.hh    |  1 +
0658e0
 src/vteseq.cc         |  4 ++++
0658e0
 7 files changed, 33 insertions(+), 2 deletions(-)
0658e0
0658e0
diff --git a/src/vte.cc b/src/vte.cc
0658e0
index 02fe5cbf2df7..38a64d17a0bf 100644
0658e0
--- a/src/vte.cc
0658e0
+++ b/src/vte.cc
0658e0
@@ -10125,6 +10125,12 @@ Terminal::emit_pending_signals()
0658e0
                               m_notification_body.c_str());
0658e0
         }
0658e0
 
0658e0
+        if (m_pending_changes & vte::to_integral(PendingChanges::SHELL_PREEXEC)) {
0658e0
+                _vte_debug_print (VTE_DEBUG_SIGNALS,
0658e0
+                                  "Emitting `shell-preexec'.\n");
0658e0
+                g_signal_emit(freezer.get(), signals[SIGNAL_SHELL_PREEXEC], 0);
0658e0
+        }
0658e0
+
0658e0
 	if (m_pending_changes & vte::to_integral(PendingChanges::TITLE)) {
0658e0
                 if (m_window_title != m_window_title_pending) {
0658e0
                         m_window_title.swap(m_window_title_pending);
0658e0
diff --git a/src/vte.sh.in b/src/vte.sh.in
0658e0
index 2c6f668142c3..fc33a63f1f84 100644
0658e0
--- a/src/vte.sh.in
0658e0
+++ b/src/vte.sh.in
0658e0
@@ -38,7 +38,7 @@ __vte_prompt_command() {
0658e0
 
0658e0
 case "$TERM" in
0658e0
   xterm*|vte*)
0658e0
-    [ -n "${BASH_VERSION:-}" ] && PROMPT_COMMAND="__vte_prompt_command"
0658e0
+    [ -n "${BASH_VERSION:-}" ] && PROMPT_COMMAND="__vte_prompt_command" && PS0=$(printf "\033]777;preexec\033\\")
0658e0
     [ -n "${ZSH_VERSION:-}"  ] && precmd_functions+=(__vte_osc7)
0658e0
     ;;
0658e0
 esac
0658e0
diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
0658e0
index 0143f0b9dd4d..2d1017f4a216 100644
0658e0
--- a/src/vte/vteterminal.h
0658e0
+++ b/src/vte/vteterminal.h
0658e0
@@ -103,9 +103,10 @@ struct _VteTerminalClass {
0658e0
 	void (*bell)(VteTerminal* terminal);
0658e0
 
0658e0
 	void (*notification_received)(VteTerminal* terminal, const gchar *summary, const gchar *body);
0658e0
+	void (*shell_preexec)(VteTerminal* terminal);
0658e0
 
0658e0
         /* Padding for future expansion. */
0658e0
-        gpointer padding[15];
0658e0
+        gpointer padding[14];
0658e0
 
0658e0
         VteTerminalClassPrivate *priv;
0658e0
 };
0658e0
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
0658e0
index b4bcd3d9a1d5..ce95126b37b8 100644
0658e0
--- a/src/vtegtk.cc
0658e0
+++ b/src/vtegtk.cc
0658e0
@@ -990,6 +990,7 @@ vte_terminal_class_init(VteTerminalClass *klass)
0658e0
 	klass->encoding_changed = NULL;
0658e0
 	klass->char_size_changed = NULL;
0658e0
 	klass->notification_received = NULL;
0658e0
+	klass->shell_preexec = NULL;
0658e0
 	klass->window_title_changed = NULL;
0658e0
 	klass->icon_title_changed = NULL;
0658e0
 	klass->selection_changed = NULL;
0658e0
@@ -1091,6 +1092,23 @@ vte_terminal_class_init(VteTerminalClass *klass)
0658e0
                              G_TYPE_NONE,
0658e0
                              2, G_TYPE_STRING, G_TYPE_STRING);
0658e0
 
0658e0
+        /**
0658e0
+         * VteTerminal::shell-preexec:
0658e0
+         * @vteterminal: the object which received the signal
0658e0
+         *
0658e0
+         * Emitted when the interactive shell has read in a complete
0658e0
+         * command and is about to execute it.
0658e0
+         */
0658e0
+        signals[SIGNAL_SHELL_PREEXEC] =
0658e0
+                g_signal_new(I_("shell-preexec"),
0658e0
+                             G_OBJECT_CLASS_TYPE(klass),
0658e0
+                             G_SIGNAL_RUN_LAST,
0658e0
+                             G_STRUCT_OFFSET(VteTerminalClass, shell_preexec),
0658e0
+                             NULL,
0658e0
+                             NULL,
0658e0
+                             g_cclosure_marshal_VOID__VOID,
0658e0
+                             G_TYPE_NONE, 0);
0658e0
+
0658e0
         /**
0658e0
          * VteTerminal::window-title-changed:
0658e0
          * @vteterminal: the object which received the signal
0658e0
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
0658e0
index 24063c3060da..e90e183e7c2d 100644
0658e0
--- a/src/vtegtk.hh
0658e0
+++ b/src/vtegtk.hh
0658e0
@@ -52,6 +52,7 @@ enum {
0658e0
         SIGNAL_RESIZE_WINDOW,
0658e0
         SIGNAL_RESTORE_WINDOW,
0658e0
         SIGNAL_SELECTION_CHANGED,
0658e0
+        SIGNAL_SHELL_PREEXEC,
0658e0
         SIGNAL_TEXT_DELETED,
0658e0
         SIGNAL_TEXT_INSERTED,
0658e0
         SIGNAL_TEXT_MODIFIED,
0658e0
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
0658e0
index fd1a8b9008cf..bb98f8bc0903 100644
0658e0
--- a/src/vteinternal.hh
0658e0
+++ b/src/vteinternal.hh
0658e0
@@ -640,6 +640,7 @@ public:
0658e0
                 CWD   = 1u << 1,
0658e0
                 CWF   = 1u << 2,
0658e0
                 NOTIFICATION = 1u << 3,
0658e0
+                SHELL_PREEXEC = 1u << 4,
0658e0
         };
0658e0
         unsigned m_pending_changes{0};
0658e0
 
0658e0
diff --git a/src/vteseq.cc b/src/vteseq.cc
0658e0
index 7ab65b6d204a..51ca37bdc748 100644
0658e0
--- a/src/vteseq.cc
0658e0
+++ b/src/vteseq.cc
0658e0
@@ -1402,6 +1402,10 @@ Terminal::handle_urxvt_extension(vte::parser::Sequence const& seq,
0658e0
                 m_notification_body = *token;
0658e0
                 return;
0658e0
         }
0658e0
+
0658e0
+        if (*token == "preexec") {
0658e0
+                m_pending_changes |= vte::to_integral(PendingChanges::SHELL_PREEXEC);
0658e0
+        }
0658e0
 }
0658e0
 
0658e0
 bool
0658e0
-- 
0658e0
2.31.1
0658e0
0658e0
0658e0
From d2e780db838ead280cf5657c49b0d63dd0683f5f Mon Sep 17 00:00:00 2001
0658e0
From: Debarshi Ray <debarshir@gnome.org>
0658e0
Date: Fri, 20 Apr 2018 18:21:53 +0200
0658e0
Subject: [PATCH 07/11] Test the shell-preexec signal
0658e0
0658e0
https://bugzilla.gnome.org/show_bug.cgi?id=711059
0658e0
https://bugzilla.gnome.org/show_bug.cgi?id=711060
0658e0
---
0658e0
 bindings/vala/app.vala | 6 ++++++
0658e0
 src/app/app.cc         | 7 +++++++
0658e0
 2 files changed, 13 insertions(+)
0658e0
0658e0
diff --git a/bindings/vala/app.vala b/bindings/vala/app.vala
0658e0
index 51b5d6410503..3975b9886d77 100644
0658e0
--- a/bindings/vala/app.vala
0658e0
+++ b/bindings/vala/app.vala
0658e0
@@ -310,6 +310,7 @@ class Window : Gtk.ApplicationWindow
0658e0
       terminal.notify.connect(notify_cb);
0658e0
 
0658e0
     terminal.notification_received.connect(notification_received_cb);
0658e0
+    terminal.shell_preexec.connect(shell_preexec_cb);
0658e0
 
0658e0
     /* Settings */
0658e0
     if (Options.no_double_buffer)
0658e0
@@ -788,6 +789,11 @@ class Window : Gtk.ApplicationWindow
0658e0
     print ("[%s]: %s\n", summary, body);
0658e0
   }
0658e0
 
0658e0
+  private void shell_preexec_cb(Vte.Terminal terminal)
0658e0
+  {
0658e0
+    print("[shell] executing command\n");
0658e0
+  }
0658e0
+
0658e0
 } /* class Window */
0658e0
 
0658e0
 class App : Gtk.Application
0658e0
diff --git a/src/app/app.cc b/src/app/app.cc
0658e0
index 90421730a66a..3caec42e5877 100644
0658e0
--- a/src/app/app.cc
0658e0
+++ b/src/app/app.cc
0658e0
@@ -1888,6 +1888,12 @@ notification_received_cb(VteTerminal *terminal,
0658e0
         g_print("[%s]: %s\n", summary, body);
0658e0
 }
0658e0
 
0658e0
+static void
0658e0
+shell_preexec_cb(VteTerminal *terminal)
0658e0
+{
0658e0
+        g_print("[shell] executing command\n");
0658e0
+}
0658e0
+
0658e0
 static void
0658e0
 window_lower_window_cb(VteTerminal* terminal,
0658e0
                        VteappWindow* window)
0658e0
@@ -2127,6 +2133,7 @@ vteapp_window_constructed(GObject *object)
0658e0
                 g_signal_connect(window->terminal, "notify", G_CALLBACK(window_notify_cb), window);
0658e0
 
0658e0
         g_signal_connect(window->terminal, "notification-received", G_CALLBACK(notification_received_cb), NULL);
0658e0
+        g_signal_connect(window->terminal, "shell-preexec", G_CALLBACK(shell_preexec_cb), NULL);
0658e0
 
0658e0
         /* Settings */
0658e0
         if (options.no_double_buffer) {
0658e0
-- 
0658e0
2.31.1
0658e0
0658e0
0658e0
From 949d4552c4ab66e02ba03024091f21bd35c199d8 Mon Sep 17 00:00:00 2001
0658e0
From: Debarshi Ray <debarshir@gnome.org>
0658e0
Date: Wed, 2 May 2018 17:20:30 +0200
0658e0
Subject: [PATCH 08/11] Support precmd notifications from an interactive shell
0658e0
0658e0
Add sequences
0658e0
  OSC 777 ; precmd BEL
0658e0
  OSC 777 ; precmd ST
0658e0
0658e0
that can be used from an interactive shell's precmd hook to notify the
0658e0
terminal emulator that a first level prompt is about to be shown.
0658e0
Examples of such hooks are Bash's PROMPT_COMMAND and Zsh's precmd.
0658e0
0658e0
The OSC 777 escape sequence is taken from Enlightenment's Terminology:
0658e0
https://phab.enlightenment.org/T1765
0658e0
0658e0
https://bugzilla.gnome.org/show_bug.cgi?id=711059
0658e0
https://bugzilla.gnome.org/show_bug.cgi?id=711060
0658e0
---
0658e0
 src/vte.cc            |  6 ++++++
0658e0
 src/vte.sh.in         |  2 +-
0658e0
 src/vte/vteterminal.h |  3 ++-
0658e0
 src/vtegtk.cc         | 18 ++++++++++++++++++
0658e0
 src/vtegtk.hh         |  1 +
0658e0
 src/vteinternal.hh    |  1 +
0658e0
 src/vteseq.cc         |  4 +++-
0658e0
 7 files changed, 32 insertions(+), 3 deletions(-)
0658e0
0658e0
diff --git a/src/vte.cc b/src/vte.cc
0658e0
index 38a64d17a0bf..6b3e1336ca15 100644
0658e0
--- a/src/vte.cc
0658e0
+++ b/src/vte.cc
0658e0
@@ -10131,6 +10131,12 @@ Terminal::emit_pending_signals()
0658e0
                 g_signal_emit(freezer.get(), signals[SIGNAL_SHELL_PREEXEC], 0);
0658e0
         }
0658e0
 
0658e0
+        if (m_pending_changes & vte::to_integral(PendingChanges::SHELL_PRECMD)) {
0658e0
+                _vte_debug_print (VTE_DEBUG_SIGNALS,
0658e0
+                                  "Emitting `shell-precmd'.\n");
0658e0
+                g_signal_emit(freezer.get(), signals[SIGNAL_SHELL_PRECMD], 0);
0658e0
+        }
0658e0
+
0658e0
 	if (m_pending_changes & vte::to_integral(PendingChanges::TITLE)) {
0658e0
                 if (m_window_title != m_window_title_pending) {
0658e0
                         m_window_title.swap(m_window_title_pending);
0658e0
diff --git a/src/vte.sh.in b/src/vte.sh.in
0658e0
index fc33a63f1f84..359afbc4645c 100644
0658e0
--- a/src/vte.sh.in
0658e0
+++ b/src/vte.sh.in
0658e0
@@ -32,7 +32,7 @@ __vte_prompt_command() {
0658e0
   local pwd='~'
0658e0
   [ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/}
0658e0
   pwd="${pwd//[[:cntrl:]]}"
0658e0
-  printf '\033]777;notify;Command completed;%s\033\\\033]0;%s@%s:%s\033\\' "${command}" "${USER}" "${HOSTNAME%%.*}" "${pwd}"
0658e0
+  printf '\033]777;notify;Command completed;%s\033\\\033]777;precmd\033\\\033]0;%s@%s:%s\033\\' "${command}" "${USER}" "${HOSTNAME%%.*}" "${pwd}"
0658e0
   __vte_osc7
0658e0
 }
0658e0
 
0658e0
diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
0658e0
index 2d1017f4a216..5e413393f7ec 100644
0658e0
--- a/src/vte/vteterminal.h
0658e0
+++ b/src/vte/vteterminal.h
0658e0
@@ -103,10 +103,11 @@ struct _VteTerminalClass {
0658e0
 	void (*bell)(VteTerminal* terminal);
0658e0
 
0658e0
 	void (*notification_received)(VteTerminal* terminal, const gchar *summary, const gchar *body);
0658e0
+	void (*shell_precmd)(VteTerminal* terminal);
0658e0
 	void (*shell_preexec)(VteTerminal* terminal);
0658e0
 
0658e0
         /* Padding for future expansion. */
0658e0
-        gpointer padding[14];
0658e0
+        gpointer padding[13];
0658e0
 
0658e0
         VteTerminalClassPrivate *priv;
0658e0
 };
0658e0
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
0658e0
index ce95126b37b8..a84f17e21f65 100644
0658e0
--- a/src/vtegtk.cc
0658e0
+++ b/src/vtegtk.cc
0658e0
@@ -990,6 +990,7 @@ vte_terminal_class_init(VteTerminalClass *klass)
0658e0
 	klass->encoding_changed = NULL;
0658e0
 	klass->char_size_changed = NULL;
0658e0
 	klass->notification_received = NULL;
0658e0
+	klass->shell_precmd = NULL;
0658e0
 	klass->shell_preexec = NULL;
0658e0
 	klass->window_title_changed = NULL;
0658e0
 	klass->icon_title_changed = NULL;
0658e0
@@ -1092,6 +1093,23 @@ vte_terminal_class_init(VteTerminalClass *klass)
0658e0
                              G_TYPE_NONE,
0658e0
                              2, G_TYPE_STRING, G_TYPE_STRING);
0658e0
 
0658e0
+        /**
0658e0
+         * VteTerminal::shell-precmd:
0658e0
+         * @vteterminal: the object which received the signal
0658e0
+         *
0658e0
+         * Emitted right before an interactive shell shows a
0658e0
+         * first-level prompt.
0658e0
+         */
0658e0
+        signals[SIGNAL_SHELL_PRECMD] =
0658e0
+                g_signal_new(I_("shell-precmd"),
0658e0
+                             G_OBJECT_CLASS_TYPE(klass),
0658e0
+                             G_SIGNAL_RUN_LAST,
0658e0
+                             G_STRUCT_OFFSET(VteTerminalClass, shell_precmd),
0658e0
+                             NULL,
0658e0
+                             NULL,
0658e0
+                             g_cclosure_marshal_VOID__VOID,
0658e0
+                             G_TYPE_NONE, 0);
0658e0
+
0658e0
         /**
0658e0
          * VteTerminal::shell-preexec:
0658e0
          * @vteterminal: the object which received the signal
0658e0
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
0658e0
index e90e183e7c2d..93a6dde3e19a 100644
0658e0
--- a/src/vtegtk.hh
0658e0
+++ b/src/vtegtk.hh
0658e0
@@ -52,6 +52,7 @@ enum {
0658e0
         SIGNAL_RESIZE_WINDOW,
0658e0
         SIGNAL_RESTORE_WINDOW,
0658e0
         SIGNAL_SELECTION_CHANGED,
0658e0
+        SIGNAL_SHELL_PRECMD,
0658e0
         SIGNAL_SHELL_PREEXEC,
0658e0
         SIGNAL_TEXT_DELETED,
0658e0
         SIGNAL_TEXT_INSERTED,
0658e0
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
0658e0
index bb98f8bc0903..25253c0af95b 100644
0658e0
--- a/src/vteinternal.hh
0658e0
+++ b/src/vteinternal.hh
0658e0
@@ -641,6 +641,7 @@ public:
0658e0
                 CWF   = 1u << 2,
0658e0
                 NOTIFICATION = 1u << 3,
0658e0
                 SHELL_PREEXEC = 1u << 4,
0658e0
+                SHELL_PRECMD = 1u << 5,
0658e0
         };
0658e0
         unsigned m_pending_changes{0};
0658e0
 
0658e0
diff --git a/src/vteseq.cc b/src/vteseq.cc
0658e0
index 51ca37bdc748..10b494bddb47 100644
0658e0
--- a/src/vteseq.cc
0658e0
+++ b/src/vteseq.cc
0658e0
@@ -1403,7 +1403,9 @@ Terminal::handle_urxvt_extension(vte::parser::Sequence const& seq,
0658e0
                 return;
0658e0
         }
0658e0
 
0658e0
-        if (*token == "preexec") {
0658e0
+        if (*token == "precmd") {
0658e0
+                m_pending_changes |= vte::to_integral(PendingChanges::SHELL_PRECMD);
0658e0
+        } else if (*token == "preexec") {
0658e0
                 m_pending_changes |= vte::to_integral(PendingChanges::SHELL_PREEXEC);
0658e0
         }
0658e0
 }
0658e0
-- 
0658e0
2.31.1
0658e0
0658e0
0658e0
From 28518832a97fc3ff2760de36cc13586c12555b62 Mon Sep 17 00:00:00 2001
0658e0
From: Debarshi Ray <debarshir@gnome.org>
0658e0
Date: Wed, 2 May 2018 17:30:48 +0200
0658e0
Subject: [PATCH 09/11] Test the shell-precmd signal
0658e0
0658e0
https://bugzilla.gnome.org/show_bug.cgi?id=711059
0658e0
https://bugzilla.gnome.org/show_bug.cgi?id=711060
0658e0
---
0658e0
 bindings/vala/app.vala | 6 ++++++
0658e0
 src/app/app.cc         | 7 +++++++
0658e0
 2 files changed, 13 insertions(+)
0658e0
0658e0
diff --git a/bindings/vala/app.vala b/bindings/vala/app.vala
0658e0
index 3975b9886d77..ff5fb5df052e 100644
0658e0
--- a/bindings/vala/app.vala
0658e0
+++ b/bindings/vala/app.vala
0658e0
@@ -310,6 +310,7 @@ class Window : Gtk.ApplicationWindow
0658e0
       terminal.notify.connect(notify_cb);
0658e0
 
0658e0
     terminal.notification_received.connect(notification_received_cb);
0658e0
+    terminal.shell_precmd.connect(shell_precmd_cb);
0658e0
     terminal.shell_preexec.connect(shell_preexec_cb);
0658e0
 
0658e0
     /* Settings */
0658e0
@@ -789,6 +790,11 @@ class Window : Gtk.ApplicationWindow
0658e0
     print ("[%s]: %s\n", summary, body);
0658e0
   }
0658e0
 
0658e0
+  private void shell_precmd_cb(Vte.Terminal terminal)
0658e0
+  {
0658e0
+    print("[shell] showing command prompt\n");
0658e0
+  }
0658e0
+
0658e0
   private void shell_preexec_cb(Vte.Terminal terminal)
0658e0
   {
0658e0
     print("[shell] executing command\n");
0658e0
diff --git a/src/app/app.cc b/src/app/app.cc
0658e0
index 3caec42e5877..0ae59d2526cb 100644
0658e0
--- a/src/app/app.cc
0658e0
+++ b/src/app/app.cc
0658e0
@@ -1888,6 +1888,12 @@ notification_received_cb(VteTerminal *terminal,
0658e0
         g_print("[%s]: %s\n", summary, body);
0658e0
 }
0658e0
 
0658e0
+static void
0658e0
+shell_precmd_cb(VteTerminal *terminal)
0658e0
+{
0658e0
+        g_print("[shell] showing command prompt\n");
0658e0
+}
0658e0
+
0658e0
 static void
0658e0
 shell_preexec_cb(VteTerminal *terminal)
0658e0
 {
0658e0
@@ -2133,6 +2139,7 @@ vteapp_window_constructed(GObject *object)
0658e0
                 g_signal_connect(window->terminal, "notify", G_CALLBACK(window_notify_cb), window);
0658e0
 
0658e0
         g_signal_connect(window->terminal, "notification-received", G_CALLBACK(notification_received_cb), NULL);
0658e0
+        g_signal_connect(window->terminal, "shell-precmd", G_CALLBACK(shell_precmd_cb), NULL);
0658e0
         g_signal_connect(window->terminal, "shell-preexec", G_CALLBACK(shell_preexec_cb), NULL);
0658e0
 
0658e0
         /* Settings */
0658e0
-- 
0658e0
2.31.1
0658e0
0658e0
0658e0
From e1c687e0651c06b72c7197e9f8f4a91122e8451c Mon Sep 17 00:00:00 2001
0658e0
From: Debarshi Ray <debarshir@gnome.org>
0658e0
Date: Mon, 10 Jun 2019 20:30:18 +0200
0658e0
Subject: [PATCH 10/11] Support tracking the active container inside the
0658e0
 terminal
0658e0
0658e0
Add sequences
0658e0
0658e0
  OSC 777 ; container ; push ; NAME ; RUNTIME ; UID BEL
0658e0
  OSC 777 ; container ; push ; NAME ; RUNTIME ; UID ST
0658e0
  OSC 777 ; container ; pop ; NAME ; RUNTIME ; UID BEL
0658e0
  OSC 777 ; container ; pop ; NAME ; RUNTIME ; UID ST
0658e0
0658e0
  OSC 777 ; container ; push ; NAME ; RUNTIME BEL
0658e0
  OSC 777 ; container ; push ; NAME ; RUNTIME ST
0658e0
  OSC 777 ; container ; pop ; NAME ; RUNTIME BEL
0658e0
  OSC 777 ; container ; pop ; NAME ; RUNTIME ST
0658e0
0658e0
that let container tools notify the terminal emulator when entering and
0658e0
leaving a container environment. The RUNTIME argument namespaces the
0658e0
NAME and identifies the container tooling being used. eg., docker,
0658e0
flatpak, podman, toolbox, etc.. The UID argument is the real UID of the
0658e0
container tools. Only those containers that are used with the same real
0658e0
UID as the VTE process are tracked.
0658e0
0658e0
The OSC 777 escape sequence is taken from Enlightenment's Terminology:
0658e0
https://phab.enlightenment.org/T1765
0658e0
0658e0
It's a VTE-specific extension until a standard escape sequence is
0658e0
agreed upon across multiple different terminal emulators [1].
0658e0
0658e0
[1] https://gitlab.freedesktop.org/terminal-wg/specifications/issues/17
0658e0
---
0658e0
 src/vte.cc            |  8 ++++
0658e0
 src/vte/vteterminal.h |  4 ++
0658e0
 src/vtegtk.cc         | 77 ++++++++++++++++++++++++++++++++++++++
0658e0
 src/vtegtk.hh         |  2 +
0658e0
 src/vteinternal.hh    | 16 ++++++++
0658e0
 src/vteseq.cc         | 86 +++++++++++++++++++++++++++++++++++++++++++
0658e0
 6 files changed, 193 insertions(+)
0658e0
0658e0
diff --git a/src/vte.cc b/src/vte.cc
0658e0
index 6b3e1336ca15..abd6b449ae48 100644
0658e0
--- a/src/vte.cc
0658e0
+++ b/src/vte.cc
0658e0
@@ -10150,6 +10150,14 @@ Terminal::emit_pending_signals()
0658e0
                 m_window_title_pending.clear();
0658e0
 	}
0658e0
 
0658e0
+	if (m_pending_changes & vte::to_integral(PendingChanges::CONTAINERS)) {
0658e0
+                _vte_debug_print(VTE_DEBUG_SIGNALS,
0658e0
+                                 "Notifying `current-container-name' and `current-container-runtime'.\n");
0658e0
+
0658e0
+                g_object_notify_by_pspec(freezer.get(), pspecs[PROP_CURRENT_CONTAINER_NAME]);
0658e0
+                g_object_notify_by_pspec(freezer.get(), pspecs[PROP_CURRENT_CONTAINER_RUNTIME]);
0658e0
+        }
0658e0
+
0658e0
 	if (m_pending_changes & vte::to_integral(PendingChanges::CWD)) {
0658e0
                 if (m_current_directory_uri != m_current_directory_uri_pending) {
0658e0
                         m_current_directory_uri.swap(m_current_directory_uri_pending);
0658e0
diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
0658e0
index 5e413393f7ec..32b2f32eef9d 100644
0658e0
--- a/src/vte/vteterminal.h
0658e0
+++ b/src/vte/vteterminal.h
0658e0
@@ -488,6 +488,10 @@ glong vte_terminal_get_column_count(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VT
0658e0
 _VTE_PUBLIC
0658e0
 const char *vte_terminal_get_window_title(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
0658e0
 _VTE_PUBLIC
0658e0
+const char *vte_terminal_get_current_container_name(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
0658e0
+_VTE_PUBLIC
0658e0
+const char *vte_terminal_get_current_container_runtime(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
0658e0
+_VTE_PUBLIC
0658e0
 const char *vte_terminal_get_current_directory_uri(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
0658e0
 _VTE_PUBLIC
0658e0
 const char *vte_terminal_get_current_file_uri(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
0658e0
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
0658e0
index a84f17e21f65..aa3f04c6a02a 100644
0658e0
--- a/src/vtegtk.cc
0658e0
+++ b/src/vtegtk.cc
0658e0
@@ -707,6 +707,12 @@ try
0658e0
                 case PROP_CURSOR_BLINK_MODE:
0658e0
                         g_value_set_enum (value, vte_terminal_get_cursor_blink_mode (terminal));
0658e0
                         break;
0658e0
+                case PROP_CURRENT_CONTAINER_NAME:
0658e0
+                        g_value_set_string (value, vte_terminal_get_current_container_name (terminal));
0658e0
+                        break;
0658e0
+                case PROP_CURRENT_CONTAINER_RUNTIME:
0658e0
+                        g_value_set_string (value, vte_terminal_get_current_container_runtime (terminal));
0658e0
+                        break;
0658e0
                 case PROP_CURRENT_DIRECTORY_URI:
0658e0
                         g_value_set_string (value, vte_terminal_get_current_directory_uri (terminal));
0658e0
                         break;
0658e0
@@ -2099,6 +2105,27 @@ vte_terminal_class_init(VteTerminalClass *klass)
0658e0
                                      NULL,
0658e0
                                      (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
0658e0
 
0658e0
+        /**
0658e0
+         * VteTerminal:current-container-name:
0658e0
+         *
0658e0
+         * The name of the current container, or %NULL if unset.
0658e0
+         */
0658e0
+        pspecs[PROP_CURRENT_CONTAINER_NAME] =
0658e0
+                g_param_spec_string ("current-container-name", NULL, NULL,
0658e0
+                                     NULL,
0658e0
+                                     (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
0658e0
+
0658e0
+        /**
0658e0
+         * VteTerminal:current-container-runtime:
0658e0
+         *
0658e0
+         * The name of the runtime toolset used to set up the current
0658e0
+         * container, or %NULL if unset.
0658e0
+         */
0658e0
+        pspecs[PROP_CURRENT_CONTAINER_RUNTIME] =
0658e0
+                g_param_spec_string ("current-container-runtime", NULL, NULL,
0658e0
+                                     NULL,
0658e0
+                                     (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
0658e0
+
0658e0
         /**
0658e0
          * VteTerminal:current-directory-uri:
0658e0
          *
0658e0
@@ -4574,6 +4601,56 @@ catch (...)
0658e0
         return -1;
0658e0
 }
0658e0
 
0658e0
+/**
0658e0
+ * vte_terminal_get_current_container_name:
0658e0
+ * @terminal: a #VteTerminal
0658e0
+ *
0658e0
+ * Returns: (nullable) (transfer none): the name of the current
0658e0
+ *   container, or %NULL
0658e0
+ */
0658e0
+const char *
0658e0
+vte_terminal_get_current_container_name(VteTerminal *terminal) noexcept
0658e0
+try
0658e0
+{
0658e0
+        g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
0658e0
+        auto impl = IMPL(terminal);
0658e0
+        if (impl->m_containers.empty())
0658e0
+                return NULL;
0658e0
+
0658e0
+        const VteContainer &container = impl->m_containers.top();
0658e0
+        return container.m_name.c_str();
0658e0
+}
0658e0
+catch (...)
0658e0
+{
0658e0
+        vte::log_exception();
0658e0
+        return NULL;
0658e0
+}
0658e0
+
0658e0
+/**
0658e0
+ * vte_terminal_get_current_container_runtime:
0658e0
+ * @terminal: a #VteTerminal
0658e0
+ *
0658e0
+ * Returns: (nullable) (transfer none): the name of the runtime
0658e0
+ *   toolset used to set up the current container, or %NULL
0658e0
+ */
0658e0
+const char *
0658e0
+vte_terminal_get_current_container_runtime(VteTerminal *terminal) noexcept
0658e0
+try
0658e0
+{
0658e0
+        g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
0658e0
+        auto impl = IMPL(terminal);
0658e0
+        if (impl->m_containers.empty())
0658e0
+                return NULL;
0658e0
+
0658e0
+        const VteContainer &container = impl->m_containers.top();
0658e0
+        return container.m_runtime.c_str();
0658e0
+}
0658e0
+catch (...)
0658e0
+{
0658e0
+        vte::log_exception();
0658e0
+        return NULL;
0658e0
+}
0658e0
+
0658e0
 /**
0658e0
  * vte_terminal_get_current_directory_uri:
0658e0
  * @terminal: a #VteTerminal
0658e0
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
0658e0
index 93a6dde3e19a..651961436225 100644
0658e0
--- a/src/vtegtk.hh
0658e0
+++ b/src/vtegtk.hh
0658e0
@@ -76,6 +76,8 @@ enum {
0658e0
         PROP_CJK_AMBIGUOUS_WIDTH,
0658e0
         PROP_CURSOR_BLINK_MODE,
0658e0
         PROP_CURSOR_SHAPE,
0658e0
+        PROP_CURRENT_CONTAINER_NAME,
0658e0
+        PROP_CURRENT_CONTAINER_RUNTIME,
0658e0
         PROP_CURRENT_DIRECTORY_URI,
0658e0
         PROP_CURRENT_FILE_URI,
0658e0
         PROP_DELETE_BINDING,
0658e0
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
0658e0
index 25253c0af95b..570c70b0c9e7 100644
0658e0
--- a/src/vteinternal.hh
0658e0
+++ b/src/vteinternal.hh
0658e0
@@ -59,6 +59,7 @@
0658e0
 #include <list>
0658e0
 #include <queue>
0658e0
 #include <optional>
0658e0
+#include <stack>
0658e0
 #include <string>
0658e0
 #include <variant>
0658e0
 #include <vector>
0658e0
@@ -97,6 +98,18 @@ typedef enum _VteCharacterReplacement {
0658e0
         VTE_CHARACTER_REPLACEMENT_LINE_DRAWING
0658e0
 } VteCharacterReplacement;
0658e0
 
0658e0
+struct VteContainer {
0658e0
+public:
0658e0
+        VteContainer(const std::string &name, const std::string &runtime) :
0658e0
+                m_name{name},
0658e0
+                m_runtime{runtime}
0658e0
+        {
0658e0
+        }
0658e0
+
0658e0
+        std::string m_name;
0658e0
+        std::string m_runtime;
0658e0
+};
0658e0
+
0658e0
 typedef struct _VtePaletteColor {
0658e0
 	struct {
0658e0
 		vte::color::rgb color;
0658e0
@@ -622,6 +635,8 @@ public:
0658e0
         gboolean m_cursor_moved_pending;
0658e0
         gboolean m_contents_changed_pending;
0658e0
 
0658e0
+        std::stack<VteContainer> m_containers;
0658e0
+
0658e0
         /* desktop notification */
0658e0
         std::string m_notification_summary;
0658e0
         std::string m_notification_body;
0658e0
@@ -642,6 +657,7 @@ public:
0658e0
                 NOTIFICATION = 1u << 3,
0658e0
                 SHELL_PREEXEC = 1u << 4,
0658e0
                 SHELL_PRECMD = 1u << 5,
0658e0
+                CONTAINERS = 1u << 6,
0658e0
         };
0658e0
         unsigned m_pending_changes{0};
0658e0
 
0658e0
diff --git a/src/vteseq.cc b/src/vteseq.cc
0658e0
index 10b494bddb47..2a2ba4b47441 100644
0658e0
--- a/src/vteseq.cc
0658e0
+++ b/src/vteseq.cc
0658e0
@@ -19,10 +19,14 @@
0658e0
 
0658e0
 #include "config.h"
0658e0
 
0658e0
+#include <string>
0658e0
+
0658e0
 #include <search.h>
0658e0
 #include <stdlib.h>
0658e0
 #include <string.h>
0658e0
 #include <limits.h>
0658e0
+#include <unistd.h>
0658e0
+#include <sys/types.h>
0658e0
 #ifdef HAVE_SYS_SYSLIMITS_H
0658e0
 #include <sys/syslimits.h>
0658e0
 #endif
0658e0
@@ -1385,6 +1389,88 @@ Terminal::handle_urxvt_extension(vte::parser::Sequence const& seq,
0658e0
         if (token == endtoken)
0658e0
                 return;
0658e0
 
0658e0
+        if (*token == "container") {
0658e0
+                ++token;
0658e0
+
0658e0
+                if (token == endtoken)
0658e0
+                        return;
0658e0
+
0658e0
+                const std::string sub_command = *token;
0658e0
+                ++token;
0658e0
+
0658e0
+                if (sub_command == "pop") {
0658e0
+                        if (token == endtoken)
0658e0
+                                return;
0658e0
+
0658e0
+                        ++token;
0658e0
+
0658e0
+                        if (token == endtoken)
0658e0
+                                return;
0658e0
+
0658e0
+                        ++token;
0658e0
+
0658e0
+                        if (token == endtoken) {
0658e0
+                                if (!m_containers.empty()) {
0658e0
+                                        m_containers.pop();
0658e0
+                                        m_pending_changes |= vte::to_integral(PendingChanges::CONTAINERS);
0658e0
+                                }
0658e0
+
0658e0
+                                return;
0658e0
+                        }
0658e0
+
0658e0
+                        const std::string uid_token = *token;
0658e0
+                        ++token;
0658e0
+
0658e0
+                        const uid_t uid = getuid();
0658e0
+                        const std::string uid_str = std::to_string(uid);
0658e0
+
0658e0
+                        if (uid_token == uid_str) {
0658e0
+                                if (!m_containers.empty()) {
0658e0
+                                        m_containers.pop();
0658e0
+                                        m_pending_changes |= vte::to_integral(PendingChanges::CONTAINERS);
0658e0
+                                }
0658e0
+
0658e0
+                                return;
0658e0
+                        }
0658e0
+
0658e0
+                        return;
0658e0
+                } else if (sub_command == "push") {
0658e0
+                        if (token == endtoken)
0658e0
+                                return;
0658e0
+
0658e0
+                        const std::string name = *token;
0658e0
+                        ++token;
0658e0
+
0658e0
+                        if (token == endtoken)
0658e0
+                                return;
0658e0
+
0658e0
+                        const std::string runtime = *token;
0658e0
+                        ++token;
0658e0
+
0658e0
+                        if (token == endtoken) {
0658e0
+                                m_containers.emplace(name, runtime);
0658e0
+                                m_pending_changes |= vte::to_integral(PendingChanges::CONTAINERS);
0658e0
+                                return;
0658e0
+                        }
0658e0
+
0658e0
+                        const std::string uid_token = *token;
0658e0
+                        ++token;
0658e0
+
0658e0
+                        const uid_t uid = getuid();
0658e0
+                        const std::string uid_str = std::to_string(uid);
0658e0
+
0658e0
+                        if (uid_token == uid_str) {
0658e0
+                                m_containers.emplace(name, runtime);
0658e0
+                                m_pending_changes |= vte::to_integral(PendingChanges::CONTAINERS);
0658e0
+                                return;
0658e0
+                        }
0658e0
+
0658e0
+                        return;
0658e0
+                }
0658e0
+
0658e0
+                return;
0658e0
+        }
0658e0
+
0658e0
         if (*token == "notify") {
0658e0
                 ++token;
0658e0
 
0658e0
-- 
0658e0
2.31.1
0658e0
0658e0
0658e0
From 4a949461c975c2d062703e161f337d84f13a60d7 Mon Sep 17 00:00:00 2001
0658e0
From: Kalev Lember <klember@redhat.com>
0658e0
Date: Tue, 16 Feb 2021 16:30:44 +0100
0658e0
Subject: [PATCH 11/11] Revert "widget: Limit select-all to the writable region
0658e0
 not including the scrollback"
0658e0
0658e0
... as decided by Fedora Workstation WG.
0658e0
0658e0
https://pagure.io/fedora-workstation/issue/216
0658e0
0658e0
This reverts commit 73713ec0644e232fb740170e399282be778d97f9.
0658e0
---
0658e0
 src/vte.cc | 9 +++------
0658e0
 1 file changed, 3 insertions(+), 6 deletions(-)
0658e0
0658e0
diff --git a/src/vte.cc b/src/vte.cc
0658e0
index abd6b449ae48..99ad5973c363 100644
0658e0
--- a/src/vte.cc
0658e0
+++ b/src/vte.cc
0658e0
@@ -6595,10 +6595,7 @@ Terminal::maybe_end_selection()
0658e0
 /*
0658e0
  * Terminal::select_all:
0658e0
  *
0658e0
- * Selects all text within the terminal. Note that we only select the writable
0658e0
- * region, *not* the scrollback buffer, due to this potentially selecting so
0658e0
- * much data that putting it on the clipboard either hangs the process for a long
0658e0
- * time or even crash it directly. (FIXME!)
0658e0
+ * Selects all text within the terminal (including the scrollback buffer).
0658e0
  */
0658e0
 void
0658e0
 Terminal::select_all()
0658e0
@@ -6607,8 +6604,8 @@ Terminal::select_all()
0658e0
 
0658e0
 	m_selecting_had_delta = TRUE;
0658e0
 
0658e0
-        m_selection_resolved.set({m_screen->insert_delta, 0},
0658e0
-                                 {_vte_ring_next(m_screen->row_data), 0});
0658e0
+        m_selection_resolved.set ({ _vte_ring_delta (m_screen->row_data), 0 },
0658e0
+                                  { _vte_ring_next  (m_screen->row_data), 0 });
0658e0
 
0658e0
 	_vte_debug_print(VTE_DEBUG_SELECTION, "Selecting *all* text.\n");
0658e0
 
0658e0
-- 
0658e0
2.31.1
0658e0