diff options
author | Ron Yorston <rmy@pobox.com> | 2021-02-03 13:46:19 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-02-03 13:46:19 +0000 |
commit | ab7a10870d7347056d86eed03f6aca62aaf4d083 (patch) | |
tree | 776553a397440cffa6d5b0f232593ad7113752e3 /win32 | |
parent | be23fca994e1dd8b81ea49cb735834e4008839fb (diff) | |
download | busybox-w32-ab7a10870d7347056d86eed03f6aca62aaf4d083.tar.gz busybox-w32-ab7a10870d7347056d86eed03f6aca62aaf4d083.tar.bz2 busybox-w32-ab7a10870d7347056d86eed03f6aca62aaf4d083.zip |
winansi: change default 'skip ANSI emulation' setting
Change the default 'skip ANSI emulation' setting which is used when
the environment variable BB_SKIP_ANSI_EMULATION is unset. Previously
it was 0 (always emulate) now it's 2 (detect whether or not the
terminal supports ANSI escape sequences and behave accordingly).
The default value is also now a build-time option.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/winansi.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/win32/winansi.c b/win32/winansi.c index 3767e7534..59292efc3 100644 --- a/win32/winansi.c +++ b/win32/winansi.c | |||
@@ -68,19 +68,9 @@ int skip_ansi_emulation(int reset) | |||
68 | 68 | ||
69 | if (skip < 0 || reset) { | 69 | if (skip < 0 || reset) { |
70 | const char *var = getenv(bb_skip_ansi_emulation); | 70 | const char *var = getenv(bb_skip_ansi_emulation); |
71 | skip = var != NULL; | 71 | skip = var == NULL ? CONFIG_SKIP_ANSI_EMULATION_DEFAULT : atoi(var); |
72 | if (skip) { | 72 | if (skip < 0 || skip > 2) |
73 | switch (xatou(var)) { | 73 | skip = 0; |
74 | case 1: | ||
75 | break; | ||
76 | case 2: | ||
77 | skip = 2; | ||
78 | break; | ||
79 | default: | ||
80 | skip = 0; | ||
81 | break; | ||
82 | } | ||
83 | } | ||
84 | 74 | ||
85 | if (is_console(STDOUT_FILENO)) { | 75 | if (is_console(STDOUT_FILENO)) { |
86 | HANDLE h = get_console(); | 76 | HANDLE h = get_console(); |