From 66b14afb9e6d1ae00109478a7d46cbc0bd56009d Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 25 Feb 2015 17:30:25 +0100 Subject: [PATCH] Fixes LP#1414332 custom commands broadcast to grouped terminals from Mauro S M Rodrigues --- terminatorlib/plugins/custom_commands.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/terminatorlib/plugins/custom_commands.py b/terminatorlib/plugins/custom_commands.py index 2af276ae..eff7c6e7 100755 --- a/terminatorlib/plugins/custom_commands.py +++ b/terminatorlib/plugins/custom_commands.py @@ -84,7 +84,8 @@ class CustomCommandsMenu(plugin.MenuItem): menuitem.set_image(image) else: menuitem = gtk.MenuItem(command["name"]) - menuitem.connect("activate", self._execute, {'terminal' : terminal, 'command' : command['command'] }) + terminals = terminal.terminator.get_target_terms(terminal) + menuitem.connect("activate", self._execute, {'terminals' : terminals, 'command' : command['command'] }) submenu.append(menuitem) def _save_config(self): @@ -108,9 +109,10 @@ class CustomCommandsMenu(plugin.MenuItem): def _execute(self, widget, data): command = data['command'] - if command[len(command)-1] != '\n': + if command[-1] != '\n': command = command + '\n' - data['terminal'].vte.feed_child(command) + for terminal in data['terminals']: + terminal.vte.feed_child(command) def configure(self, widget, data = None): ui = {}