/********************************************************* ScrollUptest.c - Tests window viewer's ability to handle ansi NEL (Next-Line or E) control function. Works as expected in XTerm windows. Works differently in Gnome terminal window. Compile: cc scrolluptest.c -o scrolluptest Run: ./scrolluptest Observe behavior. *********************************************************/ #include main() { int j = 0; printf("%c[2J%c[H\n", 27, 27 ); /* Clear text-window. */ for (j=0; j < 70; j++) /* Populate lines downward */ { /* toward bottom of screen. */ printf("%cE %d", 27, j ); fflush(stdout); usleep( 100000 ); } for (j=0; j < 70; j++) /* Lines above should now scroll upward */ { /* as each is E sent. */ printf("%cE", 27, j ); fflush(stdout); usleep( 100000 ); } }