def terminateCursesTerminal(stdscr): """Terminate the curses terminal.""" unicurses.nocbreak() unicurses.keypad(stdscr, False) unicurses.curs_set(True) unicurses.timeout(True) unicurses.echo() unicurses.endwin()
def initializeCursesTerminal(): """Initialize the curses terminal and return the window object.""" stdscr = unicurses.initscr() unicurses.start_color() unicurses.noecho() unicurses.cbreak() unicurses.keypad(stdscr, True) unicurses.timeout(False) unicurses.curs_set(False) return stdscr