aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-10-24 08:43:50 +0100
committerRon Yorston <rmy@pobox.com>2023-10-24 08:43:50 +0100
commit035b860aa381a2d9f21f075240d317a4cb9c8c64 (patch)
tree8dae96bf8742265bdacf637c9a08b7d1cce40107
parentd6b76411684d9cc7a676e98bd9f39daecfe8af36 (diff)
downloadbusybox-w32-035b860aa381a2d9f21f075240d317a4cb9c8c64.tar.gz
busybox-w32-035b860aa381a2d9f21f075240d317a4cb9c8c64.tar.bz2
busybox-w32-035b860aa381a2d9f21f075240d317a4cb9c8c64.zip
win32: avoid terminal weirdness induced by Gradle
Commit 87a3ddc06 (win32: avoid terminal weirdness induced by Gradle?) correctly diagnosed the problem but got the cure wrong. Reset DISABLE_NEWLINE_AUTO_RETURN in the new mode, not the old one. Otherwise the change isn't applied. Saves 48 bytes. (GitHub issue #372)
-rw-r--r--win32/winansi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/win32/winansi.c b/win32/winansi.c
index 20a8cc210..ff4f4b118 100644
--- a/win32/winansi.c
+++ b/win32/winansi.c
@@ -121,10 +121,10 @@ int terminal_mode(int reset)
121 if (is_console(STDOUT_FILENO)) { 121 if (is_console(STDOUT_FILENO)) {
122 h = get_console(); 122 h = get_console();
123 if (GetConsoleMode(h, &oldmode)) { 123 if (GetConsoleMode(h, &oldmode)) {
124 // Turn off DISABLE_NEWLINE_AUTO_RETURN induced by Gradle?
125 oldmode &= ~DISABLE_NEWLINE_AUTO_RETURN;
126 // Try to recover from mode 0 induced by SSH. 124 // Try to recover from mode 0 induced by SSH.
127 newmode = oldmode == 0 ? 3 : oldmode; 125 newmode = oldmode == 0 ? 3 : oldmode;
126 // Turn off DISABLE_NEWLINE_AUTO_RETURN induced by Gradle?
127 newmode &= ~DISABLE_NEWLINE_AUTO_RETURN;
128 128
129 if ((mode & VT_OUTPUT)) { 129 if ((mode & VT_OUTPUT)) {
130 newmode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; 130 newmode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;