From f917fbdac5b7ecccdc2f2a061def447a43bc093c Mon Sep 17 00:00:00 2001 From: Gregory Gauthier Date: Thu, 29 Jan 2026 16:27:40 +0000 Subject: [PATCH] trying to fix the console hang --- src/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 6efd10f..9a4f5e0 100644 --- a/src/main.c +++ b/src/main.c @@ -55,7 +55,7 @@ static void parse_arguments(int argc, char **argv, char *filename, char *difficu /* Main game loop */ static int main_game_loop(int argc, char *argv[]) { WINDOW *stdscr; - static GameState game; + static GameState game; /* static to avoid stack overflow on DOS */ char filename[MAX_FILENAME]; char difficulty[32]; char message[MAX_MESSAGE] = ""; @@ -73,7 +73,14 @@ static int main_game_loop(int argc, char *argv[]) { noecho(); /* Don't echo typed characters */ cbreak(); /* Disable line buffering */ curs_set(0); +#ifdef PLATFORM_DOS + /* PDCurses on DOS: disable keypad to avoid escape sequence delays */ + keypad(stdscr, FALSE); + /* Allow Ctrl+Break to work properly */ + raw(); +#else keypad(stdscr, TRUE); /* Enable special key detection */ +#endif clear(); /* Initialize colors */