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

using new_tab_cmd and hsplit,vsplit from terminatorlib causes an error. #938

Open
ktostam opened this issue Aug 9, 2024 · 0 comments
Open

Comments

@ktostam
Copy link

ktostam commented Aug 9, 2024

I want to call from an external python script function to create a new tab in terminator or split (hsplit or vsplit) as needed.

When I want to split the window horizontally or vertically, there is no problem.However, when I create a new tab using the new_tab_cmd function, the new tab appears as it should, but after this operation it is no longer possible to split the window.

simple code to reproduce:

import gi
gi.require_version('Gdk','3.0')
from terminatorlib import ipc

# split terminal first
ipc.hsplit(ipc.get_focused_terminal(None), {"execute":"/usr/bin/tmux", "title":"title"})
ipc.vsplit(ipc.get_focused_terminal(None), {"execute":"/usr/bin/tmux", "title":"title"})

# add new tab
ipc.new_tab_cmdline({'profile':'test','command':'/usr/bin/tmux', 'working_directory': '~'})

# and after new_tab_cmdline.
ipc.hsplit(ipc.get_focused_terminal(None), {"execute":"/usr/bin/tmux", "title":"title"})

after last command, I get error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.12/site-packages/terminatorlib/ipc.py", line 349, in _exec
    return func(proxy, *args, **argd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/terminatorlib/ipc.py", line 387, in hsplit
    print(session.hsplit(uuid,options))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.AttributeError: Traceback (most recent call last):
  File "/usr/lib64/python3.12/site-packages/dbus/service.py", line 712, in _message_cb
    retval = candidate_method(self, *args, **keywords)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/terminatorlib/ipc.py", line 155, in hsplit
    return self.new_terminal_cmd(uuid=uuid, title=title, cmd=cmd, split_vert=True)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/terminatorlib/ipc.py", line 207, in new_terminal_cmd
    sibling.spawn_child(init_command=cmd)
  File "/usr/lib/python3.12/site-packages/terminatorlib/terminal.py", line 1540, in spawn_child
    elif options and options.execute:
                     ^^^^^^^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'execute'
  • OS Fedora release 40 (Forty)
  • Display Technology: X11
  • Python: 3.12
  • Terminator version: 2.1.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant