From 90f6d119cfa15a004cfe16a4155bb43ce5b7aa32 Mon Sep 17 00:00:00 2001 From: Vhati Date: Fri, 1 Feb 2019 20:23:31 -0500 Subject: [PATCH] GUI: Flush debugger prompts on text console When built with enable-text-console and disable-readline, flushing output immediately after printing the debugger prompt, before waiting for input, ensures that external tools can spawn ScummVM, detect the prompt, and pipe in automated responses (e.g., expect scripts). Explicit flushing was necessary at least on Windows, where support for automating terminal input is less sophisticated. Otherwise, the prompt string doesn't make it through the pipe, and both the script and ScummVM get stuck waiting for input. --- gui/debugger.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gui/debugger.cpp b/gui/debugger.cpp index febd10300a7..43f600922ad 100644 --- a/gui/debugger.cpp +++ b/gui/debugger.cpp @@ -257,6 +257,7 @@ void Debugger::enter() { do { printf("debug> "); + ::fflush(stdout); if (!fgets(buf, sizeof(buf), stdin)) return;