ncurses terminal size
问题 How do I find the terminal width & height of an ncurses application? 回答1: void getmaxyx(WINDOW *win, int y, int x); i believe... also, this may help... Getting terminal width in C? 回答2: ncurses applications normally handle SIGWINCH and use the ioctl with TIOCGWINSZ to obtain the system's notion of the screensize. That may be overridden by the environment variables LINES and COLUMNS (see use_env). Given that, the ncurses global variables LINES and COLS are updated as a side-effect when wgetch