display: don't let a SIGCONT write anything to the screen

The old praxis of calling total_refresh() upon a SIGCONT was confusing,
because the screen would look as if nano had returned from suspension,
but in fact the shell was still active.

Instead of calling total_refresh(), put a no-op key into ncurses' buffer,
so that, when nano actually does return out of suspension (through 'fg'),
this key will be read and discarded, upon which nano will go sit and wait
for the next key, just before which it calls doupdate().  The latter is
all we need to get the entire screen restored.

This also fixes https://savannah.gnu.org/bugs/?51131 for "tiny".
master
Benno Schulenberg 2017-06-02 13:19:19 +02:00
parent a2038a9b2b
commit 84ff9ebb91
1 changed files with 4 additions and 5 deletions

View File

@ -1267,15 +1267,14 @@ RETSIGTYPE do_continue(int signal)
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
/* Perhaps the user resized the window while we slept. So set that /* Perhaps the user resized the window while we slept. */
* flag, and tickle the input routine so that it will see the flag. */
the_window_resized = TRUE; the_window_resized = TRUE;
ungetch(KEY_F0);
#else #else
/* Restore the state of the terminal and redraw the whole screen. */ /* Restore the state of the terminal. */
terminal_init(); terminal_init();
total_refresh();
#endif #endif
/* Tickle the input routine so it will update the screen. */
ungetch(KEY_F0);
} }
#ifndef NANO_TINY #ifndef NANO_TINY