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 /include | |
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 'include')
-rw-r--r-- | include/libbb.h | 3 | ||||
-rw-r--r-- | include/mingw.h | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/libbb.h b/include/libbb.h index 94f0e40ec..4197a5e83 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -2375,7 +2375,8 @@ extern const char bbvar[] ALIGN1; | |||
2375 | #define bbafter(p) (p + sizeof(#p)) | 2375 | #define bbafter(p) (p + sizeof(#p)) |
2376 | #define BB_OVERRIDE_APPLETS bbvar | 2376 | #define BB_OVERRIDE_APPLETS bbvar |
2377 | #define BB_SKIP_ANSI_EMULATION bbafter(BB_OVERRIDE_APPLETS) | 2377 | #define BB_SKIP_ANSI_EMULATION bbafter(BB_OVERRIDE_APPLETS) |
2378 | #define BB_SYSTEMROOT bbafter(BB_SKIP_ANSI_EMULATION) | 2378 | #define BB_TERMINAL_MODE bbafter(BB_SKIP_ANSI_EMULATION) |
2379 | #define BB_SYSTEMROOT bbafter(BB_TERMINAL_MODE) | ||
2379 | #endif | 2380 | #endif |
2380 | 2381 | ||
2381 | extern const int const_int_0; | 2382 | extern const int const_int_0; |
diff --git a/include/mingw.h b/include/mingw.h index 6259bc2c6..b5b2fe169 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -545,6 +545,9 @@ char *is_prefixed_with_case(const char *string, const char *key) FAST_FUNC; | |||
545 | char *is_suffixed_with_case(const char *string, const char *key) FAST_FUNC; | 545 | char *is_suffixed_with_case(const char *string, const char *key) FAST_FUNC; |
546 | void qsort_string_vector_case(char **sv, unsigned count) FAST_FUNC; | 546 | void qsort_string_vector_case(char **sv, unsigned count) FAST_FUNC; |
547 | 547 | ||
548 | #define VT_OUTPUT 1 | ||
549 | #define VT_INPUT 2 | ||
550 | |||
548 | /* | 551 | /* |
549 | * helpers | 552 | * helpers |
550 | */ | 553 | */ |
@@ -581,7 +584,7 @@ char *xabsolute_path(char *path); | |||
581 | char *get_drive_cwd(const char *path, char *buffer, int size); | 584 | char *get_drive_cwd(const char *path, char *buffer, int size); |
582 | void fix_path_case(char *path); | 585 | void fix_path_case(char *path); |
583 | void make_sparse(int fd, off_t start, off_t end); | 586 | void make_sparse(int fd, off_t start, off_t end); |
584 | int skip_ansi_emulation(int reset); | 587 | int terminal_mode(int reset); |
585 | int unix_path(const char *path); | 588 | int unix_path(const char *path); |
586 | int has_path(const char *file); | 589 | int has_path(const char *file); |
587 | int is_relative_path(const char *path); | 590 | int is_relative_path(const char *path); |