I’m porting an application from Solaris/curses to Linux/ncurses.
The applications uses scr_dump() and scr_restore() a lot when popping up boxes, or launching child applications.
If the terminal is made bigger by the user between the scr_dump() and scr_restore(), the application will crash in the ncurses library – sometimes it displays rubbish in the
extended area then crashes. It works fine on Solaris/curses. I’m using xterm and teraterm.
Sample…
#include <ncurses.h>
void
main(int argc, char *argv[] )
{
WINDOW *win = initscr();
erase();
mvprintw(3, 10, "This is the main screen.");
const char *filename = "scr_dump.dmp";
scr_dump(filename);
erase();
mvprintw(5, 10, "Make the screen bigger, then press a to continue");
while ( getch() != 'a' )
continue;
scr_restore(filename);
doupdate();
mvprintw(8,10,"Press a to exit");
while ( getch() != 'a' )
continue;
endwin();
}