Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-36982: Add support for extended color functions in ncurses 6.1 #17536

Open
wants to merge 10 commits into
base: master
from

Conversation

@hpjansson
Copy link

hpjansson commented Dec 9, 2019

This is a rebase of @websurfer5's #13534 against master, since that PR no longer applies cleanly and has not been updated since May. It now appears to pass the check that was failing in #13534 (review).

The original description from @websurfer5's PR follows.


ncurses 6.1 adds extended color functions to support terminals with 256 colors (e.g. xterm-256color). The extended functions use color-pair values that are signed integers because the existing functions only use signed short integer values that are too small to support the 65,536 color-pair values needed for a 256-color terminal.

The new extended color functions are used transparently by curses.color_content(), curses.init_color(), curses.init_pair(), and curses.pair_content() when available, and the original functions are used when they aren't. The module functions validate their parameters as signed integers when using the new extended functions and as signed short integers when using the original library functions to match the underlying ncurses function parameters. The original behavior remains unchanged when Python is built with a curses library that does not contain the new extended color functions.

A new function, curses.has_extended_color_support(), indicates whether extended color support is provided by the underlying ncurses library.

This PR also fixes issue #36630.

https://bugs.python.org/issue36982

@the-knights-who-say-ni

This comment has been minimized.

Copy link

the-knights-who-say-ni commented Dec 9, 2019

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@hpjansson

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@hpjansson

This comment has been minimized.

Copy link
Author

hpjansson commented Dec 9, 2019

I signed the CLA earlier today, hopefully it shows up in the system soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.