if stdscr.getch() == curses.KEY_RESIZE: curses.resizeterm(*stdscr.getmaxyx()) stdscr.clear() stdscr.refresh()