fix traceback on dragging and dropping files from a file manager

This commit is contained in:
Matt Rose 2020-05-01 23:35:36 -04:00
parent fe9e041b61
commit 808a6aa91c
1 changed files with 4 additions and 2 deletions

View File

@ -1115,8 +1115,10 @@ class Terminal(Gtk.VBox):
# https://bugs.launchpad.net/terminator/+bug/1518705 # https://bugs.launchpad.net/terminator/+bug/1518705
if info == self.TARGET_TYPE_MOZ: if info == self.TARGET_TYPE_MOZ:
txt = txt.decode('utf-16').encode('utf-8') txt = txt.decode('utf-16')
txt = txt.split('\n')[0] txt = txt.split('\n')[0]
else:
txt = txt.decode()
txt_lines = txt.split( "\r\n" ) txt_lines = txt.split( "\r\n" )
if txt_lines[-1] == '': if txt_lines[-1] == '':
@ -1529,7 +1531,7 @@ class Terminal(Gtk.VBox):
def feed(self, text): def feed(self, text):
"""Feed the supplied text to VTE""" """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): def zoom_in(self):
"""Increase the font size""" """Increase the font size"""