Skip to content

gh-136687: Add ./configure --with-curses to select the curses backend#153992

Merged
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:curses-with-curses
Jul 19, 2026
Merged

gh-136687: Add ./configure --with-curses to select the curses backend#153992
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:curses-with-curses

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Add --with-curses=ncursesw|ncurses|curses|no, mirroring --with-readline.

The default (auto) keeps the current behaviour: prefer ncursesw, fall back to ncurses. --with-curses=curses links the system's native curses (for example on NetBSD or Solaris), which has no pkg-config file and was previously unreachable; it is built with wide-character support when the library provides it. --without-curses excludes the curses and _curses_panel modules from the build.

This supersedes #136696, which added a boolean --disable-curses: --without-curses covers that request, and the option adds backend selection on top.

…ackend

Add --with-curses=ncursesw|ncurses|curses|no, mirroring --with-readline.
The default (auto) keeps the current behaviour: prefer ncursesw, fall back
to ncurses.  --with-curses=curses links the system's native curses (e.g. on
NetBSD or Solaris), which has no pkg-config file and was previously
unreachable; it is built with wide-character support when the library
provides it.  --without-curses excludes the curses and _curses_panel modules
from the build.

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

read-the-docs-community Bot commented Jul 18, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33651599 | 📁 Comparing 242508f against main (46e950f)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

serhiy-storchaka and others added 2 commits July 18, 2026 18:59
The probe declared a wchar_t array whose subscript was mangled by m4
quoting, so it failed to compile and native curses was always detected as
narrow.  Use a wide string literal instead, with no brackets to quote.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ackend

Detect the pkgsrc ncurses panel, which is installed as "gnupanel" (with a
"gnu" prefix) so it does not clash with a system libpanel.  Without this the
panel search falls back to a mismatched system libpanel, and _curses_panel
then operates on _curses windows from a different curses library and crashes.

For the native "curses" backend, probe only the plain <curses.h>/<panel.h>:
a system may also have ncurses headers, and picking those while linking the
native library mixes incompatible declarations (e.g. tparm()) with the
native <term.h>.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) July 19, 2026 05:43
@serhiy-storchaka
serhiy-storchaka merged commit 3c274d0 into python:main Jul 19, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant