Skip to content

Commit

Permalink
vte compability of feed_child arguments
Browse files Browse the repository at this point in the history
fix Guake#1222

Signed-off-by: Gaetan Semet <[email protected]>
  • Loading branch information
gsemet committed Apr 2, 2018
1 parent abf8291 commit 5e63398
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ Dependencies
Here are the dependencies of Guake for its execution:

- GTK: 3.18
- VTE: 2.91 (`vte-0.42 <https://packages.ubuntu.com/xenial/gir1.2-vte-2.91>`_)
- VTE: 2.91 (`0.42 <https://packages.ubuntu.com/xenial/gir1.2-vte-2.91>`_).
See `doc here <https://lazka.github.io/pgi-docs/#Vte-2.91>`_
- ``gir1.2-keybinder-3.0``
- ``gir1.2-notify-0.7``
- ``gir1.2-vte-2.91``
Expand Down
6 changes: 3 additions & 3 deletions guake/guake_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def execute_command(self, command, tab=None):
index = self.notebook.get_current_page()
index = tab or self.notebook.get_current_page()
for terminal in self.notebook.get_terminals_for_tab(index):
terminal.feed_child(command, len(command))
terminal.feed_child(command)
break

def execute_command_by_uuid(self, tab_uuid, command):
Expand All @@ -566,7 +566,7 @@ def execute_command_by_uuid(self, tab_uuid, command):
else:
terminals = self.notebook.get_terminals_for_tab(tab_index)
for current_vte in terminals:
current_vte.feed_child(command, len(command))
current_vte.feed_child(command)

# TODO this is dead: 2eae380b1a91a24f6c1eb68c13dac33db98a6ea2 and
# 3f8c344519c9228deb9ca5f181cbdd5ef1d6acc0
Expand Down Expand Up @@ -1565,7 +1565,7 @@ def on_drag_data_received(self, widget, context, x, y, selection, target, timest
else:
text = str.join("", (shell_quote(path) + " " for path in pathlist))

box.terminal.feed_child(text, len(command))
box.terminal.feed_child(text)
return True

# -- tab related functions --
Expand Down
9 changes: 8 additions & 1 deletion guake/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ def pid(self):
def pid(self, pid):
self._pid = pid

def feed_child(self, resolved_cmdline):
try:
super().feed_child(resolved_cmdline, len(resolved_cmdline))
except TypeError:
# vte > 0.42 only takes 1 parameter
super().feed_child(resolved_cmdline)

def copy_clipboard(self):
if self.get_has_selection():
super(GuakeTerminal, self).copy_clipboard()
Expand Down Expand Up @@ -306,7 +313,7 @@ def _execute_quick_open(self, filepath, line_number):
logging.debug("Executing it in current tab")
if resolved_cmdline[-1] != '\n':
resolved_cmdline += '\n'
self.feed_child(resolved_cmdline, len(resolved_cmdline))
self.feed_child(resolved_cmdline)
else:
logging.debug("Executing it independently")
subprocess.call(resolved_cmdline, shell=True)
Expand Down
3 changes: 3 additions & 0 deletions releasenotes/notes/vte-d6fd6406c673f71a.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fixes:
- |
Support for vte 2.91 (0.52) #1222

0 comments on commit 5e63398

Please sign in to comment.