diff --git a/guake/dbusiface.py b/guake/dbusiface.py index 2002e7e7c..fc7d939e0 100755 --- a/guake/dbusiface.py +++ b/guake/dbusiface.py @@ -202,6 +202,16 @@ def v_split_current_terminal(self): def h_split_current_terminal(self): self.guake.get_notebook().get_current_terminal().get_parent().split_h() + @dbus.service.method(DBUS_NAME, in_signature="s") + def v_split_current_terminal_with_command(self, command): + self.guake.get_notebook().get_current_terminal().get_parent().split_v() + self.guake.execute_command(command) + + @dbus.service.method(DBUS_NAME, in_signature="s") + def h_split_current_terminal_with_command(self, command): + self.guake.get_notebook().get_current_terminal().get_parent().split_h() + self.guake.execute_command(command) + @dbus.service.method(DBUS_NAME, in_signature="s", out_signature="i") def get_index_from_uuid(self, tab_uuid): return self.guake.get_index_from_uuid(tab_uuid) diff --git a/guake/main.py b/guake/main.py index 8b6cd4958..19b140f7a 100644 --- a/guake/main.py +++ b/guake/main.py @@ -542,11 +542,17 @@ def main(): only_show_hide = options.show if options.split_vertical: - remote_object.v_split_current_terminal() + if options.command: + remote_object.v_split_current_terminal_with_command(options.command) + else: + remote_object.v_split_current_terminal() only_show_hide = options.show if options.split_horizontal: - remote_object.h_split_current_terminal() + if options.command: + remote_object.h_split_current_terminal_with_command(options.command) + else: + remote_object.h_split_current_terminal() only_show_hide = options.show if options.selected_terminal: @@ -563,7 +569,7 @@ def main(): sys.stderr.write(f"invalid index: {selected}\n") only_show_hide = options.show - if options.command: + if options.command and not (options.split_vertical or options.split_horizontal): remote_object.execute_command(options.command) only_show_hide = options.show diff --git a/releasenotes/notes/execute_split_tabs-44ea0b6657ea45a7.yaml b/releasenotes/notes/execute_split_tabs-44ea0b6657ea45a7.yaml new file mode 100644 index 000000000..97ecd9f42 --- /dev/null +++ b/releasenotes/notes/execute_split_tabs-44ea0b6657ea45a7.yaml @@ -0,0 +1,8 @@ +release_summary: > + execute command flag now runs commands in new split tabs if --split-vertical or --split-horizontal are also provided. + + +fixes: + - | + + - Options --select-tab, --split-vertical (--split-horizontal) and -execute-command not working as before (v. 3.8.4). #2167