Skip to content

Preferences freeze for 3-4 seconds when opened with TypeError in keybinding filter#1088

Draft
thiagobraga wants to merge 1 commit into
gnome-terminator:masterfrom
thiagobraga:fix/prefs-filter-none-type-error
Draft

Preferences freeze for 3-4 seconds when opened with TypeError in keybinding filter#1088
thiagobraga wants to merge 1 commit into
gnome-terminator:masterfrom
thiagobraga:fix/prefs-filter-none-type-error

Conversation

@thiagobraga

Copy link
Copy Markdown

Steps to reproduce

  1. Run Terminator
  2. Right-click in the terminal → Preferences
  3. UI freezes for ~3-4 seconds before showing the Preferences window

Observed behavior

The Preferences window takes 3-4 seconds to appear. The following error is logged to syslog:

terminator.desktop: TypeError: object of type 'NoneType' has no len()

Root cause

In terminatorlib/prefseditor.py:filter_visible(), when a keybinding exists in the merged config dict but its value is None (which happens when a plugin registers a keybinding and the main config overrides it with an unbound/null value), data[act] returns None. The code then calls len(None), raising TypeError.
GTK's TreeModelFilter likely swallows the exception but the overhead of repeatedly hitting this error for every row causes the multi-second freeze.

Fix

Changed data[act] if act in data else "" → data.get(act) or "", ensuring keys is always a string regardless of whether the dict value is None, missing, or empty.

When a keybinding in the merged config dict has a value of None (e.g. an
unbound plugin action overridden by main config), data[act] returns None
instead of a string. Using data.get(act) or '' ensures keys is always
a string, preventing 'TypeError: object of type NoneType has no len()'
that caused Preferences to freeze for 3-4 seconds on open.
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

Successfully merging this pull request may close these issues.

1 participant