From 0f39109d6bb4ed14b51164791621620cc6b5d461 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 4 Apr 2026 13:48:45 +0200 Subject: Curses: handle window resizes when blocking in `^T` and don't return function keys * There was a logic error in teco_interface_getch() that caused Curses function key codes to be returned directly. These codes however are useless to macro authors and can be confused with codepoints. You cannot report function keys in the same "namespace" along with Unicode codepoints. They are now filtered out. * Also make sure that Backspace and Return are reported as 8 and 10 respectively in all Curses variants. All control codes reported by Curses are passed down unmodified - in contrast to the command-line input handling. I.e. 13 is not normalized to 10. * PDCursesMod/WinGUI may return bogus key presses, that also have to be filtered out as we already did in the main input handling. A function teco_interface_check_key() has been introduced. * NOTE: teco_interface_blocking_getch() already makes sure that recovery files are dumped even when blocking in `^T`. --- src/interface-gtk/interface.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/interface-gtk/interface.c') diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c index 08ccf5d..f88813b 100644 --- a/src/interface-gtk/interface.c +++ b/src/interface-gtk/interface.c @@ -479,6 +479,7 @@ teco_interface_getch_input_cb(GtkWidget *widget, GdkEvent *event, gpointer user_ teco_interrupted = TRUE; /* fall through */ case TECO_CTL_KEY('D'): + /* emulates EOF on stdin */ *cp = -1; } break; -- cgit v1.2.3