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

Crash after unzooming a single terminal inside a tab #835

Closed
Vulcalien opened this issue Oct 10, 2023 · 5 comments
Closed

Crash after unzooming a single terminal inside a tab #835

Vulcalien opened this issue Oct 10, 2023 · 5 comments

Comments

@Vulcalien
Copy link
Member

To Reproduce
Open Terminator. Open a tab. Zoom the single terminal in it (Ctrl+Shift+X), then unzoom it.

Desktop: (pretty sure it's not relevant)

  • OS or Linux Distribution: Linux Mint
  • Version: 21
  • Display Technology: X11

Describe the bug
Terminator crashes when unzooming a single terminal inside a tab. When there are 2 or more terminals, the issue doesn't occur. I did a git bisect, and found that the commit introducing the bug is 11639159, pushed for PR #810. The problems seems to be here:

#notify plugins of tab-change
dbg("emit tab-change for tabpos: %s " % tabpos)
term_widget.emit('tab-change', tabpos)
self.set_current_page(tabpos)
widget.grab_focus()

in Notebook.newtab. The problem disappears when term_widget.emit('tab-change', tabpos) is removed.

When it doesn't crash, I see an extremely large number of new tabs, all containing the same terminal. Maybe it gets confused by the fact there is only one terminal..?

@vssdeo
Copy link
Contributor

vssdeo commented Oct 17, 2023

Let me also look into this, this PR seems to be mine. I have figured out the reason for the the trigger, where zoomed terminal calls def tab_change(self, widget, num=None, ignore = None): to unzoom which in turn creates a newtab everytime in a loop. I wanted to reused tab-change event and not add another one. I have two solutions in mind let me get a patch for this.

Terminator::find_terminal_by_uuid: checking: urn:uuid:9c5467f0-a14b-406b-9c11-c814058f4451 (<terminal.Terminal object at 0x7fc5de3c5f00 (terminatorlib+terminal+Terminal at 0x2dc3db0)>) (/home/user/dev/terminator/terminatorlib/terminator.py:187)
Traceback (most recent call last):
  File "/home/user/dev/terminator/terminatorlib/notebook.py", line 519, in do_deferred_on_tab_switch
    self.on_tab_switch(*self.pending_on_tab_switch_args)
  File "/home/user/dev/terminator/terminatorlib/notebook.py", line 527, in on_tab_switch
    term = self.terminator.find_terminal_by_uuid(tabs_last_active_term.urn)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/dev/terminator/terminatorlib/terminator.py", line 189, in find_terminal_by_uuid
    if terminal.get_toplevel().is_child_notebook():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Notebook' object has no attribute 'is_child_notebook'

Then on restore (unzoom) it goes into repeat spiral.

Notebook::newtab: creating TabLabel with text: user@kali: ~/dev/terminator (/home/user/dev/terminator/terminatorlib/notebook.py:316)
Notebook::newtab: inserting page at position: 1 (/home/user/dev/terminator/terminatorlib/notebook.py:323)

(terminator:20321): Gtk-WARNING **: 00:47:59.080: Can't set a parent on widget which has a parent
ConfigBase::get_item: detachable_tabs found in globals: True (/home/user/dev/terminator/terminatorlib/config.py:790)
Terminator::find_terminal_by_uuid: searching self.terminals for: urn:uuid:ac750de6-4d46-43f9-bc35-5999788a85e0 (/home/user/dev/terminator/terminatorlib/terminator.py:185)
Terminator::find_terminal_by_uuid: checking: urn:uuid:9c5467f0-a14b-406b-9c11-c814058f4451 (<terminal.Terminal object at 0x7fc5de3c5f00 (terminatorlib+terminal+Terminal at 0x2dc3db0)>) (/home/user/dev/terminator/terminatorlib/terminator.py:187)


vssdeo added a commit to vssdeo/terminator that referenced this issue Oct 20, 2023
…ome-terminator#835

-removed previous code to start fresh
-added event type for tab-change since other way of identifying zoomed widget was not simple and clear
-emit tab-change is done at a single point now in notebook.py
vssdeo added a commit to vssdeo/terminator that referenced this issue Oct 20, 2023
…lear-search-between-commands gnome-terminator#846

- using widget.get_toplevel().get_focussed_terminal() to get current term
- added event_type for tab-change emit as per gnome-terminator#835
vssdeo added a commit to vssdeo/terminator that referenced this issue Oct 24, 2023
…ome-terminator#835

- removing the tab-change event dependency and having a simpler solution with focus-in
vssdeo added a commit to vssdeo/terminator that referenced this issue Oct 24, 2023
…lear-search-between-commands gnome-terminator#846

- this includes the changes in gnome-terminator#835 since its required to decouple
- made plugin dependent on focus-in and removed tab-change
- plugin is now decoupled from main terminator code
@vssdeo
Copy link
Contributor

vssdeo commented Oct 24, 2023

Removed the tab-change emit code. New pull request has a decoupled plugin code using focus-in event.

mattrose added a commit that referenced this issue Feb 16, 2024
…e-terminal-inside-a-tab

[bug 835] 835-crash-after-unzooming-a-single-terminal-inside-a-tab #835
@Vulcalien
Copy link
Member Author

I can gladly state that it's fixed now!

@vssdeo
Copy link
Contributor

vssdeo commented Feb 19, 2024

I can gladly state that it's fixed now!

@Vulcalien thanks for finding this bug on time, else It would have been difficult. In addition thanks to you I was able to implement the code in a simpler way.

@Vulcalien
Copy link
Member Author

I was able to implement the code in a simpler way

That's great, glad to be helpful!

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

2 participants