Skip to content

Commit

Permalink
Run -e in new tabs generated by split vertical/horizontal
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidy22 committed May 9, 2023
1 parent 172a9c0 commit bf61cec
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
10 changes: 10 additions & 0 deletions guake/dbusiface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 9 additions & 3 deletions guake/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
8 changes: 8 additions & 0 deletions releasenotes/notes/execute_split_tabs-44ea0b6657ea45a7.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bf61cec

Please sign in to comment.