Skip to content

gh-156138: Keep the color pair when a curses write restores the rendition - #156139

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:fix-156138
Aug 21, 2026
Merged

gh-156138: Keep the color pair when a curses write restores the rendition#156139
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:fix-156138

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 20, 2026

Copy link
Copy Markdown
Member

addstr(), addnstr(), insstr() and insnstr() saved the window rendition with getattrs() and put it back with wattrset(), whose A_COLOR field holds only pairs 0 to 255, so a window using a larger pair lost it.

Save and restore the pair with wattr_get() and wattr_set() where they exist.

No NEWS entry: a window could not use such a pair before 3.16, which is unreleased.

… rendition

addstr(), addnstr(), insstr() and insnstr() saved the window rendition with
getattrs() and put it back with wattrset(), whose A_COLOR field holds only
pairs 0 to 255, so a window using a larger pair lost it.  Save and restore
the pair with wattr_get() and wattr_set() where they exist.
@serhiy-storchaka
serhiy-storchaka merged commit 0f9fb00 into python:main Aug 21, 2026
55 checks passed
@serhiy-storchaka
serhiy-storchaka deleted the fix-156138 branch August 21, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant