aboutsummaryrefslogtreecommitdiff
path: root/gui/debugger.cpp
diff options
context:
space:
mode:
authorVhati2019-02-01 20:23:31 -0500
committerFilippos Karapetis2019-02-03 22:16:40 +0200
commit90f6d119cfa15a004cfe16a4155bb43ce5b7aa32 (patch)
tree00a9501015287dfb3ef292cd37558ad6b25af328 /gui/debugger.cpp
parent4129da510e448f68e34e26890edefb0fbc002ca4 (diff)
downloadscummvm-rg350-90f6d119cfa15a004cfe16a4155bb43ce5b7aa32.tar.gz
scummvm-rg350-90f6d119cfa15a004cfe16a4155bb43ce5b7aa32.tar.bz2
scummvm-rg350-90f6d119cfa15a004cfe16a4155bb43ce5b7aa32.zip
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.
Diffstat (limited to 'gui/debugger.cpp')
-rw-r--r--gui/debugger.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index febd10300a..43f600922a 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;