我看到这个答案正在研究以解决我的问题https://stackoverflow.com/a/8407120/2570513,但是,它仅适用于标准屏幕。我实现了这个:
#include <ncurses.h>
int main(void)
{
int i = 2, height, width;
WINDOW *new;
initscr();
getmaxyx(stdscr, height, width);
new = newwin(height - 2, width - 2, 1, 1);
scrollok(new,TRUE);
while(1)
{
mvwprintw(new, i, 2, "%d - lots and lots of lines flowing down the terminal", i);
++i;
wrefresh(new);
}
endwin();
return 0;
}
但它不滚动。怎么了?