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

Save button throws KeyError when a multiple tab layout is saved using Save Button after closing the Preference window using close button #971

Open
vssdeo opened this issue Dec 11, 2024 · 0 comments

Comments

@vssdeo
Copy link
Contributor

vssdeo commented Dec 11, 2024

Launch terminator in debug mode -d

  1. create a layout with 2 tabs.
  2. save layout. Ensure you press close button in preferences and NOT (x) on top
  3. open preferences->layout again and selected the newly created layout with 2 tabs.
  4. press save

you will get the error below.

-whats happening is that on pressing close button in preferences.

        terminator.reconfigure() is called via on_closebutton_clicked(...)
        which in turn calls configure in notebook.py and clears
        self.last_active_term = {}

        on on pressing save point 4 above, that, eventually describe_layout in container.py gets called for Notebook and while setting it using self.get_nth_page, a KeyError is thrown since the terminal object was cleared as explained above.

        last_active_term.append(self.last_active_term[self.get_nth_page(tabnum)])
Traceback (most recent call last):
  File "/home/user/dev/terminator/terminatorlib/prefseditor.py", line 1615, in on_layoutrefreshbutton_clicked
    current_layout = terminator.describe_layout()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/dev/terminator/terminatorlib/terminator.py", line 629, in describe_layout
    count = window.describe_layout(count, parent, layout, 0, save_cwd)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/dev/terminator/terminatorlib/container.py", line 336, in describe_layout
    count = child.describe_layout(count, name, global_layout, child_order, save_cwd)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/dev/terminator/terminatorlib/container.py", line 314, in describe_layout
    last_active_term.append(self.last_active_term[self.get_nth_page(tabnum)])
                            ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: <terminal.Terminal object at 0x7fc933399a40 (terminatorlib+terminal+Terminal at 0x22195d0)>
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