Python's documentation needs some work, but basically the problem is that it's used for two different underlying implementations:
- ncurses provides
resizeterm
and resize_term
entrypoints, but those respond to SIGWINCH
(a longstanding *nix feature but only recently quasi-standardized):
The function resizeterm
resizes the standard and current windows (i.e.,
stdscr
and curscr
) to the specified dimensions, and adjusts other
bookkeeping data used by the ncurses library that record the window
dimensions such as the LINES
and COLS
variables.
- PDCurses has a
resize_term
function which can resize the window:
resize_term()
is effectively two functions: When called with nonzero values for nlines and ncols, it attempts to resize the screen to the given size. When called with (0, 0), it merely adjusts the internal structures to match the current size after the screen is resized by the user. On the currently supported platforms, SDL, Windows console, and X11 allow user resizing, while DOS, OS/2, SDL and Windows console allow programmatic resizing. If you want to support user resizing, you should check for getch()
returning KEY_RESIZE
, and/or call is_termresized() at appropriate times; if either condition occurs, call resize_term(0, 0). Then, with either user or programmatic resizing, you’ll have to resize any windows you’ve created, as appropriate; resize_term()
only handles stdscr and curscr.
PDCurses's resize_term
(1998, version 2.3) came after ncurses's resizeterm
(1995), and rather than implementing the same feature, modified that (to resize the window rather than responding to the user's resizing it). ncurses added a resize_term
in 2002 after that to solve a different problem. The Git repo for PDCurses, by the way, only goes back to version 2.4 (I have tarballs).
PDCurses's documentation also needs some work, but the X11 port does respond to SIGWINCH
(hence the KEY_RESIZE
which it adapted from ncurses), but resizing the window rather than responding to SIGWINCH
was what it did for the Windows version.