diff -r 3111a0a67084 Doc/library/curses.rst --- a/Doc/library/curses.rst Mon Apr 13 17:35:31 2015 -0400 +++ b/Doc/library/curses.rst Mon Apr 13 18:40:21 2015 -0400 @@ -599,6 +599,11 @@ Only one *ch* can be pushed before :meth:`getch` is called. +.. function:: update_lines_cols() + + Update curses.LINES and curses.COLS. Useful for detecting manual screen resize. + + .. function:: unget_wch(ch) Push *ch* so the next :meth:`get_wch` will return it. diff -r 3111a0a67084 Modules/_cursesmodule.c --- a/Modules/_cursesmodule.c Mon Apr 13 17:35:31 2015 -0400 +++ b/Modules/_cursesmodule.c Mon Apr 13 18:40:21 2015 -0400 @@ -2865,6 +2865,13 @@ Py_DECREF(m); return 1; } + +static PyObject * +PyCurses_update_lines_cols(PyObject *self) +{ + return PyLong_FromLong((long) update_lines_cols()); +} + #endif #ifdef HAVE_CURSES_RESIZETERM @@ -3267,6 +3274,9 @@ {"typeahead", (PyCFunction)PyCurses_TypeAhead, METH_VARARGS}, {"unctrl", (PyCFunction)PyCurses_UnCtrl, METH_VARARGS}, {"ungetch", (PyCFunction)PyCurses_UngetCh, METH_VARARGS}, +#if defined(HAVE_CURSES_RESIZETERM) || defined(HAVE_CURSES_RESIZE_TERM) + {"update_lines_cols", (PyCFunction)PyCurses_update_lines_cols, METH_NOARGS}, +#endif #ifdef HAVE_NCURSESW {"unget_wch", (PyCFunction)PyCurses_Unget_Wch, METH_VARARGS}, #endif