From 808a6aa91c4bbdd3ff0259773c1a6ea0deddf28b Mon Sep 17 00:00:00 2001 From: Matt Rose Date: Fri, 1 May 2020 23:35:36 -0400 Subject: [PATCH] fix traceback on dragging and dropping files from a file manager --- terminatorlib/terminal.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 6a2a445b..6a80d2f8 100644 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -1115,8 +1115,10 @@ class Terminal(Gtk.VBox): # https://bugs.launchpad.net/terminator/+bug/1518705 if info == self.TARGET_TYPE_MOZ: - txt = txt.decode('utf-16').encode('utf-8') + txt = txt.decode('utf-16') txt = txt.split('\n')[0] + else: + txt = txt.decode() txt_lines = txt.split( "\r\n" ) if txt_lines[-1] == '': @@ -1529,7 +1531,7 @@ class Terminal(Gtk.VBox): def feed(self, text): """Feed the supplied text to VTE""" - self.vte.feed_child(text, len(text)) + self.vte.feed_child_binary(text.encode(self.vte.get_encoding())) def zoom_in(self): """Increase the font size"""