bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Crash when restoring screen


From: Frank Tkalcevic
Subject: Crash when restoring screen
Date: Mon, 18 Oct 2021 05:33:23 +0000

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();

}

 

 

 


Frank Tkalcevic
Senior Software Engineer
T   +61 3 8610 2480
Level 25, 333 Collins StreetMelbourne VIC 3000Australia
Website  |  LinkedIn  |  Facebook  |  Blackstone
Disclaimer  |  Privacy Policy


 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]