diff options
author | Ron Yorston <rmy@pobox.com> | 2023-10-22 12:42:50 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-10-22 12:42:50 +0100 |
commit | 87a3ddc0620fb3ff022663bf2241b92b483e3cf0 (patch) | |
tree | 7acc6706ff652a96e1d5f78fe86d617af3f92f4d | |
parent | 9a4fe0bc63f2e98bac0e647e12620929d8658e50 (diff) | |
download | busybox-w32-87a3ddc0620fb3ff022663bf2241b92b483e3cf0.tar.gz busybox-w32-87a3ddc0620fb3ff022663bf2241b92b483e3cf0.tar.bz2 busybox-w32-87a3ddc0620fb3ff022663bf2241b92b483e3cf0.zip |
win32: avoid terminal weirdness induced by Gradle?
GitHub issue #372 reports that in certain circumstances (which I've
been unable to reproduce) Gradle leaves the terminal in a state
where linefeeds seem not to result in a carriage return.
This *might* be because Gradle sets DISABLE_NEWLINE_AUTO_RETURN in
the terminal mode. Reset DISABLE_NEWLINE_AUTO_RETURN to zero before
the shell prompt is issued to see of this makes any difference.
Costs 16-32 bytes.
-rw-r--r-- | win32/winansi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/win32/winansi.c b/win32/winansi.c index b5111603c..20a8cc210 100644 --- a/win32/winansi.c +++ b/win32/winansi.c | |||
@@ -121,6 +121,8 @@ 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; | ||
124 | // Try to recover from mode 0 induced by SSH. | 126 | // Try to recover from mode 0 induced by SSH. |
125 | newmode = oldmode == 0 ? 3 : oldmode; | 127 | newmode = oldmode == 0 ? 3 : oldmode; |
126 | 128 | ||