From 4757632f9ed18b8989a75d2f99f6e7b32654e01d Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 16 May 2020 03:57:36 -0700 Subject: [PATCH] SCP: Enable line wrapping at EOL on Windows console (Peter Schorn) Simulators running directly in a Windows console session, that don't have the console traffic redirected to a telnet session via SET CONSOLE TELNET=nnn now behave similarly to the default behavior experienced on non-windows hosts where the terminal session usually defaults to wrapping at EOL. Users who want more specific control of this behavior can run their console via a telnet session with a terminal emulator that lets them explicitly set these features in the emulator. This change reintroduces this behavior which got lost when windows support for ANSI (VT100) escape sequences were added to the console sessions. --- sim_console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim_console.c b/sim_console.c index bb5e04b4..341f7e83 100644 --- a/sim_console.c +++ b/sim_console.c @@ -3454,8 +3454,8 @@ if ((sim_ttisatty ()) && if ((std_output) && /* If Not Background process? */ (std_output != INVALID_HANDLE_VALUE)) { if (GetConsoleMode(std_output, &saved_output_mode)) - if (!SetConsoleMode(std_output, ENABLE_VIRTUAL_TERMINAL_PROCESSING|ENABLE_PROCESSED_OUTPUT)) - SetConsoleMode(std_output, ENABLE_PROCESSED_OUTPUT); + if (!SetConsoleMode(std_output, ENABLE_VIRTUAL_TERMINAL_PROCESSING|ENABLE_PROCESSED_OUTPUT|ENABLE_WRAP_AT_EOL_OUTPUT)) + SetConsoleMode(std_output, ENABLE_PROCESSED_OUTPUT|ENABLE_WRAP_AT_EOL_OUTPUT); } if (sim_log) { fflush (sim_log);