According to this link, https://docs.python.org/3/library/curses.html, the description for curses.resizeterm(), it should be possible to fix the width and height of my terminal window to a fixed values of my interest, no? I wrote a simple code below
import curses
def main( stdscr ):
stdscr.resizeterm( 20, 20 )
stdscr.clear()
stdscr.addstr( 10, 10, "o" )
stdscr.refresh()
curses.napms( 3000 )
curses.wrapper( main )
But it returns the error message AttributeError: '_curses.window' object has no attribute 'resizeterm'. If I remove the resizeterm line, it works fine, but of course the size of the screen is not necessarily 20 by 20! If I put it in front of curses instead of stdscr, then it gives a similar error message again AttributeError: module 'curses' has no attribute 'resizeterm'. How should one use this resizeterm?


Python's documentation needs some work, but basically the problem is that it's used for two different underlying implementations:
resizetermandresize_termentrypoints, but those respond toSIGWINCH(a longstanding *nix feature but only recently quasi-standardized):resize_termfunction which can resize the window:PDCurses's
resize_term(1998, version 2.3) came after ncurses'sresizeterm(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 aresize_termin 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 theKEY_RESIZEwhich it adapted from ncurses), but resizing the window rather than responding toSIGWINCHwas what it did for the Windows version.