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

KeyError when a single window layout is selected after selecting a multiple tab layouts second terminal #973

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

Comments

@vssdeo
Copy link
Contributor

vssdeo commented Dec 14, 2024

Launch terminator (2.1.4) in debug mode -d

1. create a layout with 2 tabs.  and ensure the default layout has only one window.
2. save layout via Add button in preferences
3. select the 2 tab layout. (you can directly select a two tab layout if you already have using context layout menu)
4. now first select the 2nd terminal of 2 tab layout AND now select the default layout

you will get the Key error below.

-whats happening is that on selecting the single window layout, the system tries to save the single window layout but with previous settings of two tab layout. So we need to ensure that when the layout item is changed the layout sub menu also gets reset to first item.

ConfigBase::save: Processing layout: New Layout 2
ConfigBase::save: Processing layout: New Layout
noclass::get_config_dir: Found config dir: /home/user/.config
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/terminatorlib/prefseditor.py", line 1847, in on_layout_item_selection_changed
    self.layouteditor.on_layout_item_selection_changed(selection)
  File "/usr/lib/python3/dist-packages/terminatorlib/prefseditor.py", line 2147, in on_layout_item_selection_changed
    self.set_layout_item(item)
  File "/usr/lib/python3/dist-packages/terminatorlib/prefseditor.py", line 2152, in set_layout_item
    layout_item = layout[self.layout_item]
                  ~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'terminal2'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/terminatorlib/prefseditor.py", line 1847, in on_layout_item_selection_changed
    self.layouteditor.on_layout_item_selection_changed(selection)
  File "/usr/lib/python3/dist-packages/terminatorlib/prefseditor.py", line 2147, in on_layout_item_selection_changed
    self.set_layout_item(item)
  File "/usr/lib/python3/dist-packages/terminatorlib/prefseditor.py", line 2152, in set_layout_item
    layout_item = layout[self.layout_item]
                  ~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'child1'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/terminatorlib/prefseditor.py", line 1847, in on_layout_item_selection_changed
    self.layouteditor.on_layout_item_selection_changed(selection)
  File "/usr/lib/python3/dist-packages/terminatorlib/prefseditor.py", line 2147, in on_layout_item_selection_changed
    self.set_layout_item(item)
  File "/usr/lib/python3/dist-packages/terminatorlib/prefseditor.py", line 2152, in set_layout_item
    layout_item = layout[self.layout_item]
                  ~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'child1'
vssdeo added a commit to vssdeo/terminator that referenced this issue Dec 14, 2024
…changed the layout sub item also gets reset to first item, else KeyError is thrown as described in bug
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