From 731b014397003ddbe07d531e5cef3e52d6e7f38a Mon Sep 17 00:00:00 2001 From: Aaron Cook Date: Thu, 15 Oct 2026 16:19:25 -0500 Subject: [PATCH 1/2] ingest: Add macros for ctrl + up/down I don't think ncurses has macros for these, but the magic numbers I have in there seem to work. So add macros for those that conform to the rest of the ncurses KEY_* naming convention. --- src/ingest.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ingest.c b/src/ingest.c index 8ec9deb..3679b2e 100644 --- a/src/ingest.c +++ b/src/ingest.c @@ -33,6 +33,13 @@ static int read_cmd_page(const char *home_dir, int idx); static void update_cmd_pg_status(void); static void inter_command_wait(void); +#ifndef KEY_CUP +# define KEY_CUP (566) +#endif +#ifndef KEY_CDOWN +# define KEY_CDOWN (525) +#endif + int ingest_start(bytenuts_t *bytenuts) { @@ -801,10 +808,10 @@ handle_functions(int ch) case KEY_SEND: /* go to front of log */ cheerios_gofwd(-1); return 1; - case 566: /* ctrl + up arrow */ + case KEY_CUP: /* ctrl + up arrow */ cheerios_goback(1); return 1; - case 525: /* ctrl + down arrow */ + case KEY_CDOWN: /* ctrl + down arrow */ cheerios_gofwd(1); return 1; case KEY_RESIZE: From 0bf4610c02ead6abbcf8e5d27954868581d07562 Mon Sep 17 00:00:00 2001 From: Aaron Cook Date: Thu, 15 Oct 2026 16:22:29 -0500 Subject: [PATCH 2/2] ingest: Define ncurses key maps for ctrl/shift shortcuts This ensure that sequences like ctrl+up or shift+end work regardless of the terminal settings. Tested with TMUX and foot. --- src/ingest.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ingest.c b/src/ingest.c index 3679b2e..e417ee2 100644 --- a/src/ingest.c +++ b/src/ingest.c @@ -53,6 +53,12 @@ ingest_start(bytenuts_t *bytenuts) ingest.cmd_pg_cur = -1; ingest.xmodem_hist = bstr_history_create(); + /* ensure character sequences work in all terminals */ + define_key("\033[1;5A", KEY_CUP); + define_key("\033[1;5B", KEY_CDOWN); + define_key("\033[1;2H", KEY_SHOME); + define_key("\033[1;2F", KEY_SEND); + HOME = getenv("HOME"); if (HOME) { int idx = 0;