Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix traceback on dragging and dropping files from a file manager #54

Merged
merged 1 commit into from
May 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions terminatorlib/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,8 +1115,10 @@ def on_drag_data_received(self, widget, drag_context, x, y, selection_data,

# 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] == '':
Expand Down Expand Up @@ -1529,7 +1531,7 @@ def paste_clipboard(self, primary=False):

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"""
Expand Down