]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-90092: Support multiple terminals in the curses module (GH-151748)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 24 Jun 2026 11:33:02 +0000 (14:33 +0300)
committerGitHub <noreply@github.com>
Wed, 24 Jun 2026 11:33:02 +0000 (11:33 +0000)
commitac023ea48f64137d1b6d8dccbd530415d1930813
tree58db72ce2b1f414375dd81ec5e2067b57a95511b
parent793f471767a1e80e8ae138e14efcf73f0233419e
gh-90092: Support multiple terminals in the curses module (GH-151748)

Add the X/Open Curses SCREEN API for driving more than one terminal:
newterm() and set_term(), plus the ncurses extension new_prescr().

A new screen object wraps the C SCREEN.  It exposes the terminal's
standard window as screen.stdscr.  Each window keeps a reference to its
screen (like a subwindow does to its parent window), so the screen is
deleted automatically once it and all of its windows are unreferenced.

The ncurses use_screen()/use_window() locking helpers are exposed as
the screen.use() and window.use() methods.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Doc/library/curses.rst
Doc/whatsnew/3.16.rst
Include/py_curses.h
Lib/curses/__init__.py
Lib/test/test_curses.py
Misc/NEWS.d/next/Library/2026-06-19-12-19-30.gh-issue-90092.yBVc0C.rst [new file with mode: 0644]
Modules/_cursesmodule.c
Modules/clinic/_cursesmodule.c.h
configure
configure.ac
pyconfig.h.in