display: redraw the screen in tiny version upon resuming from suspension

Letting the dummy key KEY_FRESH do a full refresh in the tiny version
allows a 'fg' to properly resume after an external SIGSTOP.

(Reminder: the ungetch() is needed in the normal version to prevent
the eating of a keystroke: https://savannah.gnu.org/bugs/?48331.)
This commit is contained in:
Benno Schulenberg 2021-11-28 11:45:21 +01:00
parent d14d9069cd
commit b5448615b9
4 changed files with 7 additions and 3 deletions

View File

@ -218,7 +218,7 @@
#define FOREIGN_SEQUENCE 0x4FC
/* A special keycode for plugging into the input stream after a suspension. */
#define KEY_FLUSH KEY_F0
#define KEY_FRESH 0x4FE
#ifndef NANO_TINY
/* A special keycode for when we get a SIGWINCH (a window resize). */

View File

@ -1503,6 +1503,8 @@ void shortcut_init(void)
add_to_sclist(MMAIN, "", KEY_SIC, do_insertfile, 0);
/* Catch and ignore bracketed paste marker keys. */
add_to_sclist(MMOST|MBROWSER|MHELP|MYESNO, "", BRACKETED_PASTE_MARKER, do_nothing, 0);
#else
add_to_sclist(MMOST|MBROWSER|MHELP|MYESNO, "", KEY_FRESH, full_refresh, 0);
#endif
}

View File

@ -991,7 +991,7 @@ void continue_nano(int signal)
#endif
/* Insert a fake keystroke, to neutralize a key-eating issue. */
ungetch(KEY_FLUSH);
ungetch(KEY_FRESH);
}
#if !defined(NANO_TINY) || defined(ENABLE_SPELLER) || defined(ENABLE_COLOR)

View File

@ -1263,7 +1263,9 @@ int parse_kbinput(WINDOW *win)
#ifdef KEY_RESIZE /* SunOS 5.7-5.9 doesn't know KEY_RESIZE. */
case KEY_RESIZE:
#endif
case KEY_FLUSH:
#ifndef NANO_TINY
case KEY_FRESH:
#endif
return ERR; /* Ignore this keystroke. */
}