Fix TypeError in select_graphic_rendition#203
Conversation
pyte/screens.py
Outdated
| self.buffer[y][x] = self.buffer[y][x]._replace(data="E") | ||
|
|
||
| def select_graphic_rendition(self, *attrs: int) -> None: | ||
| def select_graphic_rendition(self, *attrs: int, **kwargs: Any) -> None: |
There was a problem hiding this comment.
Can this be private: bool = False so that we don't allow arbitrary kwargs here?
There was a problem hiding this comment.
Yes, you're absolutely right. Using private: bool = False is much better than **kwargs.
I used the existing **kwargs pattern as a reference from other methods in the codebase, but you're correct that explicit parameters are better. I noticed that set_mode(), reset_mode(), erase_in_display(), and report_device_attributes() also use the same pattern for the private parameter. Should I refactor those methods for consistency as well?
There was a problem hiding this comment.
Let's keep the rest as is and only change select_graphic_rendition.
808df45 to
eaa831d
Compare
|
Would you mind adding a test for this to avoid regressions in the future? |
- Add private parameter to select_graphic_rendition() method signature - Handle private=True parameter by returning early (no-op for private SGR sequences)
- Add test_private_sgr_sequence_ignored() to verify Vim 9.0+ modifyOtherKeys query is ignored - Test ensures private SGR sequences don't affect screen display, modes, or cursor state
eaa831d to
48d43d4
Compare
Done |
Fixes #202
privateparameter to select_graphic_rendition() method signatureprivate=Trueparameter by returning early (no-op for private SGR sequences)