Skip to content

gh-152332: Add the curses.term_attrs() function#152333

Open
serhiy-storchaka wants to merge 3 commits into
python:mainfrom
serhiy-storchaka:curses-term-attrs
Open

gh-152332: Add the curses.term_attrs() function#152333
serhiy-storchaka wants to merge 3 commits into
python:mainfrom
serhiy-storchaka:curses-term-attrs

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Add the X/Open term_attrs() function, the attr_t counterpart of the already-exposed termattrs().

term_attrs() returns the logical OR of all video attributes supported by the terminal as :ref:WA_* <curses-wa-constants> values, where termattrs() returns the equivalent A_* values as a chtype.

It is implemented with PyLong_FromUnsignedLong() rather than the int-returning helper used by termattrs(), because attr_t is unsigned (and 64-bit on an lp64 ncurses build).

term_attrs() returns the video attributes supported by the terminal as
WA_* values, the counterpart of termattrs() for the A_* values.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@read-the-docs-community

read-the-docs-community Bot commented Jun 26, 2026

Copy link
Copy Markdown

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