Skip to main content

Support for the standard curses module on Windows

Project description

Update: Add support for Fullwidth Unicode Characters! CJK languages support finally!

Adds support for the standard Python curses module on Windows. Based on these wheels. Uses the PDCurses curses implementation.

The wheels are built from this GitHub repository.

PDCurses is compiled with wide character support, meaning get_wch() is available. UTF-8 is forced as the encoding.

Starting from windows-curses 2.0, in the name of pragmatism, these wheels (but not Gohlke's) include a hack to make resizing work for applications developed against ncurses without Python code changes: Whenever getch(), getkey(), or get_wch() return KEY_RESIZE, resize_term(0, 0) is called automatically. This gives behavior similar to the automatic SIGWINCH handling in ncurses (see PDCurses' resize_term() documentation). This commit implements the hack.

To add the same hack in Python code (which is harmless, and needed if you want resizing to work with older windows-curses versions or with Gohlke's wheels), call curses.resize_term(0, 0) after receiving KEY_RESIZE, and ignore any curses.error exceptions. ncurses reliably fails and does nothing for resize_term(0, 0), so this is safe on *nix.

Please tell me if the resize_term(0, 0) hackery causes you any trouble.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

windows_curses_ywmod-2.3.2a3-cp311-cp311-win_amd64.whl (87.2 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file windows_curses_ywmod-2.3.2a3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for windows_curses_ywmod-2.3.2a3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fc6f9f9d21d8bbd04cf7ef5f90b8149c261ad1fdf6285b79054a86d86b6dd64a
MD5 680341a92b0d148b7fbc13838a806a3f
BLAKE2b-256 0aefb2a979aa689343eda58640eaeffa95c45380020afddf45657d0b1b42f2fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page