nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit b5448615b952aced295da1f401430a6c97ded7f0
parent d14d9069cd203b7a59c6184e8de802df8ec2c417
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 28 Nov 2021 11:45:21 +0100

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.)

Diffstat:
Msrc/definitions.h | 2+-
Msrc/global.c | 2++
Msrc/nano.c | 2+-
Msrc/winio.c | 4+++-
4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/definitions.h b/src/definitions.h @@ -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). */ diff --git a/src/global.c b/src/global.c @@ -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 } diff --git a/src/nano.c b/src/nano.c @@ -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) diff --git a/src/winio.c b/src/winio.c @@ -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. */ }