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.
This commit is contained in:
Vhati 2019-02-01 20:23:31 -05:00 committed by Filippos Karapetis
parent 4129da510e
commit 90f6d119cf

View File

@ -257,6 +257,7 @@ void Debugger::enter() {
do {
printf("debug> ");
::fflush(stdout);
if (!fgets(buf, sizeof(buf), stdin))
return;