diff options
author | Ron Yorston <rmy@pobox.com> | 2023-03-05 12:31:30 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-03-05 12:31:30 +0000 |
commit | f52c2004b818ac739ec886d5ff0a87734b55d293 (patch) | |
tree | e68d21ec6e1673e458d1e5b3827c08af146cd14a /shell | |
parent | 76d3eafb4c28bc6579baff917ffe7726acf6817a (diff) | |
download | busybox-w32-f52c2004b818ac739ec886d5ff0a87734b55d293.tar.gz busybox-w32-f52c2004b818ac739ec886d5ff0a87734b55d293.tar.bz2 busybox-w32-f52c2004b818ac739ec886d5ff0a87734b55d293.zip |
win32: changes to console mode handling
Add the environment variable BB_TERMINAL_MODE as a more general way
of controlling console/terminal mode setting. The default remains
unchanged: use virtual terminal mode for output if possible but
fall back to the console API with emulated ANSI escape sequences.
Currently valid settings are:
0 Force use of console mode
1 Force use of virtual terminal mode for output
5 Prefer virtual terminal mode for output, fall back to console
Other values won't do anything useful until code elsewhere has been
updated.
BB_SKIP_ANSI_EMULATION remains available for backwards compatibility.
If both variables are set BB_TERMINAL_MODE takes precedence.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/shell/ash.c b/shell/ash.c index 742067216..d78c6e828 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -2340,9 +2340,9 @@ static void change_realtime(const char *) FAST_FUNC; | |||
2340 | 2340 | ||
2341 | #if ENABLE_PLATFORM_MINGW32 | 2341 | #if ENABLE_PLATFORM_MINGW32 |
2342 | static void FAST_FUNC | 2342 | static void FAST_FUNC |
2343 | change_skip_ansi(const char *newval UNUSED_PARAM) | 2343 | change_terminal_mode(const char *newval UNUSED_PARAM) |
2344 | { | 2344 | { |
2345 | skip_ansi_emulation(TRUE); | 2345 | terminal_mode(TRUE); |
2346 | } | 2346 | } |
2347 | 2347 | ||
2348 | # define LINENO_INDEX (5 + 2 * ENABLE_ASH_MAIL + ENABLE_ASH_GETOPTS) | 2348 | # define LINENO_INDEX (5 + 2 * ENABLE_ASH_MAIL + ENABLE_ASH_GETOPTS) |
@@ -2387,7 +2387,8 @@ static const struct { | |||
2387 | { VSTRFIXED|VTEXTFIXED|VUNSET, "HISTFILE" , NULL }, | 2387 | { VSTRFIXED|VTEXTFIXED|VUNSET, "HISTFILE" , NULL }, |
2388 | #endif | 2388 | #endif |
2389 | #if ENABLE_PLATFORM_MINGW32 | 2389 | #if ENABLE_PLATFORM_MINGW32 |
2390 | { VSTRFIXED|VTEXTFIXED|VUNSET, BB_SKIP_ANSI_EMULATION, change_skip_ansi }, | 2390 | { VSTRFIXED|VTEXTFIXED|VUNSET, BB_SKIP_ANSI_EMULATION, change_terminal_mode }, |
2391 | { VSTRFIXED|VTEXTFIXED|VUNSET, BB_TERMINAL_MODE, change_terminal_mode }, | ||
2391 | #endif | 2392 | #endif |
2392 | }; | 2393 | }; |
2393 | 2394 | ||
@@ -14603,7 +14604,7 @@ cmdloop(int top) | |||
14603 | inter++; | 14604 | inter++; |
14604 | chkmail(); | 14605 | chkmail(); |
14605 | #if ENABLE_PLATFORM_MINGW32 | 14606 | #if ENABLE_PLATFORM_MINGW32 |
14606 | skip_ansi_emulation(TRUE); | 14607 | terminal_mode(TRUE); |
14607 | #endif | 14608 | #endif |
14608 | } | 14609 | } |
14609 | n = parsecmd(inter); | 14610 | n = parsecmd(inter); |