Title: Add curses.scr_dump(), scr_restore(), scr_init() and scr_set() · Issue #152260 · python/cpython · GitHub
Open Graph Title: Add curses.scr_dump(), scr_restore(), scr_init() and scr_set() · Issue #152260 · python/cpython
X Title: Add curses.scr_dump(), scr_restore(), scr_init() and scr_set() · Issue #152260 · python/cpython
Description: The curses module can serialize a single window with window.putwin() / curses.getwin(), but it has no way to dump and restore the whole screen. The four X/Open functions that do this are still missing: scr_dump(filename) — write the curr...
Open Graph Description: The curses module can serialize a single window with window.putwin() / curses.getwin(), but it has no way to dump and restore the whole screen. The four X/Open functions that do this are still miss...
X Description: The curses module can serialize a single window with window.putwin() / curses.getwin(), but it has no way to dump and restore the whole screen. The four X/Open functions that do this are still miss...
Opengraph URL: https://github.com/python/cpython/issues/152260
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add curses.scr_dump(), scr_restore(), scr_init() and scr_set()","articleBody":"The curses module can serialize a single window with `window.putwin()` / `curses.getwin()`, but it has no way to dump and restore the whole screen. The four X/Open functions that do this are still missing:\n\n* `scr_dump(filename)` — write the current virtual screen to a file.\n* `scr_restore(filename)` — set the virtual screen to a dumped file; the next `doupdate()`/`refresh()` paints it.\n* `scr_init(filename)` — use a dump as the assumed current terminal contents (e.g. after another program drew the screen).\n* `scr_set(filename)` — combine `scr_restore()` and `scr_init()`.\n\nThese are the whole-screen counterpart of `putwin()`/`getwin()`. Unlike those (which take a Python file object, mirroring C `putwin(WINDOW *, FILE *)`), the C `scr_*` functions are filename-based (they `fopen` internally), so the Python wrappers take a filename — a `str` or a path-like object.\n\nProposed API:\n\n curses.scr_dump(filename)\n curses.scr_restore(filename)\n curses.scr_init(filename)\n curses.scr_set(filename)\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-152261\n* gh-152340\n* gh-152390\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2026-06-26T10:26:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/152260/cpython/issues/152260"}
| 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:5af0e371-fdbf-e805-fcc7-97b5cb7596fa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D434:1C4F87:495C00:61BCB7:6A529615 |
| html-safe-nonce | 5610a826fbd4b439f8bb1cea09832c0d5f045b77798bce549b803bc3010343da |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDM0OjFDNEY4Nzo0OTVDMDA6NjFCQ0I3OjZBNTI5NjE1IiwidmlzaXRvcl9pZCI6IjM2MzM0ODk5MzU1OTg3ODYwNjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c1bbe0c8bb2fa4a07735412c792d28e7c14793ed7d8cb1ac66725db2e38052b3 |
| hovercard-subject-tag | issue:4751246649 |
| 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/152260/issue_layout |
| twitter:image | https://opengraph.githubassets.com/735f3915abfe8ed06387efc842986fc36efd5ceb2ece90ca7afcc9bc173f1266/python/cpython/issues/152260 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/735f3915abfe8ed06387efc842986fc36efd5ceb2ece90ca7afcc9bc173f1266/python/cpython/issues/152260 |
| og:image:alt | The curses module can serialize a single window with window.putwin() / curses.getwin(), but it has no way to dump and restore the whole screen. The four X/Open functions that do this are still miss... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width