diff --git a/TerminalFrontend.cc b/TerminalFrontend.cc index d1b3ec8..94ac0c8 100644 --- a/TerminalFrontend.cc +++ b/TerminalFrontend.cc @@ -43,7 +43,9 @@ TerminalFrontend::Init(int &argc, char **argv, Editor &ed) // Enable 8-bit meta key sequences (Alt/ESC-prefix handling in terminals) meta(stdscr, TRUE); // Make ESC key sequences resolve quickly so ESC+ works as meta -#ifdef set_escdelay + // set_escdelay is an ncurses extension function (not a macro), so test for + // ncurses itself rather than `#ifdef set_escdelay`, which is always false. +#if defined(NCURSES_VERSION) set_escdelay(TerminalFrontend::kEscDelayMs); #endif // Make getch() block briefly instead of busy-looping; reduces CPU when idle diff --git a/TerminalInputHandler.cc b/TerminalInputHandler.cc index d4e0d27..5fbfa81 100644 --- a/TerminalInputHandler.cc +++ b/TerminalInputHandler.cc @@ -165,9 +165,10 @@ map_key_to_command(const int ch, out = {true, CommandId::DeleteChar, "", 0}; return true; case KEY_RESIZE: - k_prefix = false; - k_ctrl_pending = false; - out = {true, CommandId::Refresh, "", 0}; + // TerminalFrontend::Step picks up the new size before the next draw. + // Refresh is the C-g cancel handler, so issuing it here would clear the + // mark and cancel open prompts on every window resize. + out.hasCommand = false; return true; default: break;