[vte/vte-0-60] widget: Emit the ::commit signal even when the terminal has no PTY



commit 606a55cbe2f1aba42023f19f3b2d2ccf4c90573b
Author: Christian Persch <chpe src gnome org>
Date:   Thu Mar 26 18:18:51 2020 +0100

    widget: Emit the ::commit signal even when the terminal has no PTY
    
    Some users drive VteTerminal entirely with vte_terminal_feed/feed_child(),
    e.g. qemu, and they rely on the ::commit signal to read the user input.
    So for now, restore the signal emission.
    
    Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/222
    (cherry picked from commit 277ee003066b3993cf6d55a05606009caac69015)

 src/vte.cc | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 0977ff6c..cba606e8 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -4154,22 +4154,23 @@ Terminal::send_child(std::string_view const& data)
         if (!m_input_enabled)
                 return;
 
-        /* If there's a place for it to go, add the data to the
-         * outgoing buffer. */
-        if (!pty())
-                return;
+        /* Note that for backward compatibility, we need to emit the
+         * ::commit signal even if there is no PTY. See issue vte#222.
+         */
 
         switch (data_syntax()) {
         case DataSyntax::eECMA48_UTF8:
                 emit_commit(data);
-                _vte_byte_array_append(m_outgoing, data.data(), data.size());
+                if (pty())
+                        _vte_byte_array_append(m_outgoing, data.data(), data.size());
                 break;
 
         case DataSyntax::eECMA48_PCTERM: {
                 auto converted = m_converter->convert(data);
 
                 emit_commit(converted);
-                _vte_byte_array_append(m_outgoing, converted.data(), converted.size());
+                if (pty())
+                        _vte_byte_array_append(m_outgoing, converted.data(), converted.size());
                 break;
         }
 


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