Title: Ncurses Extended Color Pairs incorrectly display as copies of lower 256 color pairs · Issue #119138 · python/cpython · GitHub
Open Graph Title: Ncurses Extended Color Pairs incorrectly display as copies of lower 256 color pairs · Issue #119138 · python/cpython
X Title: Ncurses Extended Color Pairs incorrectly display as copies of lower 256 color pairs · Issue #119138 · python/cpython
Description: Bug report Bug description: When using ncurses extended color pairs, introduced in Python 3.10 in PR #17536 and issue #81163, the color pairs past 256 don't seem to work. When accessed, pairs 256+ repeat the behavior of pairs 0-255 inste...
Open Graph Description: Bug report Bug description: When using ncurses extended color pairs, introduced in Python 3.10 in PR #17536 and issue #81163, the color pairs past 256 don't seem to work. When accessed, pairs 256+ ...
X Description: Bug report Bug description: When using ncurses extended color pairs, introduced in Python 3.10 in PR #17536 and issue #81163, the color pairs past 256 don't seem to work. When accessed, pairs 2...
Opengraph URL: https://github.com/python/cpython/issues/119138
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ncurses Extended Color Pairs incorrectly display as copies of lower 256 color pairs","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\nWhen using ncurses extended color pairs, introduced in Python 3.10 in PR #[17536](https://github.com/python/cpython/pull/17536) and issue #81163, the color pairs past 256 don't seem to work. When accessed, pairs 256+ repeat the behavior of pairs 0-255 instead of the colors set by curses.init_pair().\r\n\r\nIn my use case, curses.has_extended_color_support() == True and curses.COLORS == 256.\r\n\r\nI can use curses.init_pair() to initialize color pairs past 255. It lets me set them without any error. But when I go to display the colors, color pair 256 displays the same as color pair 0, 257 displays the same as 1, and so on.\r\n\r\nI created a small test program to reproduce the issue by initializing, displaying, and letting you scroll through the extended color pairs, examining pairs 0-65536: https://gist.github.com/cmang/7d366f677cd067c00e58a9d9c97141c5\r\n\r\nThe test program initializes 256 * 256 (65536) color pairs, using every FG and BG combination for FG and BG colors 0-255. It then lets you use the left/right arrow keys to scroll through the pairs. It requires an xterm-256color capable terminal. \r\n\r\nIn the following screenshot, the test program shows each color pair number in its given color and you can see that the pairs repeat. The expected behavior is that pairs 256-512 should have a different background color set (red), as should the next 256 pairs (green), etc.\r\n\r\n\u003cimg width=\"715\" alt=\"Screenshot 2024-05-18 at 4 18 41 AM\" src=\"https://github.com/python/cpython/assets/261501/e7c8fd87-e885-4884-aa86-4bab50ac04a3\"\u003e\r\n\r\nEdit: If you get an error running the test program, make your terminal larger.\r\n\r\n@hpjansson @websurfer5 \r\n\r\nThanks!\r\n\r\n### CPython versions tested on:\r\n\r\n3.10, 3.11, 3.12\r\n\r\n### Operating systems tested on:\r\n\r\nLinux, macOS","author":{"url":"https://github.com/cmang","@type":"Person","name":"cmang"},"datePublished":"2024-05-18T10:00:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/119138/cpython/issues/119138"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5ce71a1d-11a2-b64f-145b-8bd173dad78a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A288:15DFF5:28DB1DF:3785972:696AE15D |
| html-safe-nonce | 986f26f738d9281ac6deb42deb6f72e1fd74b45f4c623e74a400373f63a40066 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjg4OjE1REZGNToyOERCMURGOjM3ODU5NzI6Njk2QUUxNUQiLCJ2aXNpdG9yX2lkIjoiNTkyNDAxNjU4MzM1MTI1ODU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 92a574958c1d48554e7b3da9abe108b5b897f2bb5d9d56e4cd79c749cd9e4690 |
| hovercard-subject-tag | issue:2303980969 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/119138/issue_layout |
| twitter:image | https://opengraph.githubassets.com/815ad8f13be3be5e9eb79466474158db653deab50b46e0598566c9e74570b7bb/python/cpython/issues/119138 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/815ad8f13be3be5e9eb79466474158db653deab50b46e0598566c9e74570b7bb/python/cpython/issues/119138 |
| og:image:alt | Bug report Bug description: When using ncurses extended color pairs, introduced in Python 3.10 in PR #17536 and issue #81163, the color pairs past 256 don't seem to work. When accessed, pairs 256+ ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cmang |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3d84d50b3c75fa36755c3cf392edbc09e626f979 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width