Skip to content

Fix HighlightTrigger.background_color property getter signature#592

Merged
gnachman merged 1 commit intognachman:masterfrom
mkusaka:fix/triggers-highlight-property-arg
Feb 24, 2026
Merged

Fix HighlightTrigger.background_color property getter signature#592
gnachman merged 1 commit intognachman:masterfrom
mkusaka:fix/triggers-highlight-property-arg

Conversation

@mkusaka
Copy link
Contributor

@mkusaka mkusaka commented Feb 23, 2026

Summary

Removed a stray value parameter from the HighlightTrigger.background_color @property getter. Accessing trigger.background_color raised TypeError because Python's property descriptor calls the getter with only self.

Background

  • The getter signature was copy-pasted from the setter below it, leaving the value: typing.Optional[iterm2.Color] parameter in place
  • The corresponding text_color property does not have this issue
  • Also added the missing return type annotation (-> typing.Optional[iterm2.Color]) to match the text_color getter

Example

trigger = HighlightTrigger(regex="error", text_color=None, background_color=None, instant=False, enabled=True)

trigger.text_color        # OK — returns None
trigger.background_color  # TypeError: background_color() missing 1 required positional argument: 'value'

Verification

Confirmed that trigger.background_color returns the expected value without TypeError, and mypy --ignore-missing-imports iterm2/triggers.py no longer reports Too many arguments for property [misc] on line 713.

The @Property getter had a stray `value` parameter copied from the
setter, causing TypeError when accessing trigger.background_color.
@gnachman gnachman merged commit f48329b into gnachman:master Feb 24, 2026
1 check passed
@mkusaka mkusaka deleted the fix/triggers-highlight-property-arg branch February 25, 2026 01:49
eyupcanakman pushed a commit to eyupcanakman/iTerm2 that referenced this pull request Mar 1, 2026
…hman#592)

The @Property getter had a stray `value` parameter copied from the
setter, causing TypeError when accessing trigger.background_color.
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.

2 participants