From a55356ec8ddee5cf5633822fed917ece88e60806 Mon Sep 17 00:00:00 2001 From: Matt Rose Date: Tue, 17 Nov 2020 12:06:16 -0500 Subject: [PATCH 1/2] replace feed_child_binary() calls with feed_child() --- terminatorlib/plugins/custom_commands.py | 2 +- terminatorlib/terminal.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/terminatorlib/plugins/custom_commands.py b/terminatorlib/plugins/custom_commands.py index f2ddfdf0..c7756c70 100644 --- a/terminatorlib/plugins/custom_commands.py +++ b/terminatorlib/plugins/custom_commands.py @@ -126,7 +126,7 @@ class CustomCommandsMenu(plugin.MenuItem): if command[-1] != '\n': command = command + '\n' for terminal in data['terminals']: - terminal.vte.feed_child_binary(command.encode(terminal.vte.get_encoding())) + terminal.vte.feed_child(command.encode(terminal.vte.get_encoding())) def configure(self, widget, data = None): ui = {} diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 021188ec..fe7e3d74 100644 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -1198,6 +1198,7 @@ class Terminal(Gtk.VBox): ### Never send a CRLF to the terminal from here txt = txt.rstrip('\r\n') for term in self.terminator.get_target_terms(self): + txt = txt.encode(self.vte.get_encoding()) term.feed(txt) return @@ -1596,7 +1597,7 @@ class Terminal(Gtk.VBox): def feed(self, text): """Feed the supplied text to VTE""" - self.vte.feed_child_binary(text.encode(self.vte.get_encoding())) + self.vte.feed_child(text) def zoom_in(self): """Increase the font size""" From 040b828ed1c3503f2fd32f5054a2f89409750349 Mon Sep 17 00:00:00 2001 From: Matt Rose Date: Tue, 17 Nov 2020 12:19:59 -0500 Subject: [PATCH 2/2] feed_child() only accepts UTF-8, so that's what we'll send for now --- terminatorlib/plugins/custom_commands.py | 2 +- terminatorlib/terminal.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/terminatorlib/plugins/custom_commands.py b/terminatorlib/plugins/custom_commands.py index c7756c70..fa16e618 100644 --- a/terminatorlib/plugins/custom_commands.py +++ b/terminatorlib/plugins/custom_commands.py @@ -126,7 +126,7 @@ class CustomCommandsMenu(plugin.MenuItem): if command[-1] != '\n': command = command + '\n' for terminal in data['terminals']: - terminal.vte.feed_child(command.encode(terminal.vte.get_encoding())) + terminal.vte.feed_child(command.encode()) def configure(self, widget, data = None): ui = {} diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index fe7e3d74..156f8b9a 100644 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -1198,8 +1198,7 @@ class Terminal(Gtk.VBox): ### Never send a CRLF to the terminal from here txt = txt.rstrip('\r\n') for term in self.terminator.get_target_terms(self): - txt = txt.encode(self.vte.get_encoding()) - term.feed(txt) + term.feed(txt.encode()) return widgetsrc = data.terminator.terminals[int(selection_data.get_data())]