From bf018a19d9d3b5b3f299e3e9b57c0b7eb679a27a Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 1 May 2017 17:47:07 -0700 Subject: [PATCH] CONSOLE: Properly set the line output mode under windows version prior to Win10 As reported in #438 by Dave Wise. --- sim_console.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sim_console.c b/sim_console.c index 5bb132a4..9e86e6bc 100644 --- a/sim_console.c +++ b/sim_console.c @@ -3229,7 +3229,8 @@ if ((std_input) && /* If Not Background pro if ((std_output) && /* If Not Background process? */ (std_output != INVALID_HANDLE_VALUE)) { if (GetConsoleMode(std_output, &saved_output_mode)) - SetConsoleMode(std_output, ENABLE_VIRTUAL_TERMINAL_PROCESSING|ENABLE_PROCESSED_OUTPUT); + if (!SetConsoleMode(std_output, ENABLE_VIRTUAL_TERMINAL_PROCESSING|ENABLE_PROCESSED_OUTPUT)) + SetConsoleMode(std_output, ENABLE_PROCESSED_OUTPUT); } if (sim_log) { fflush (sim_log);