diff options
author | Ron Yorston <rmy@pobox.com> | 2021-02-15 16:00:25 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-02-15 16:00:25 +0000 |
commit | 1ade2225d2d6bf44399b37fd8411cd44a7fea99a (patch) | |
tree | 912fd66d2363f69c8d937e4ea1ac2e0cc2941c9d | |
parent | c07e998a46b5ee3be1720413d660745b552b8c85 (diff) | |
download | busybox-w32-1ade2225d2d6bf44399b37fd8411cd44a7fea99a.tar.gz busybox-w32-1ade2225d2d6bf44399b37fd8411cd44a7fea99a.tar.bz2 busybox-w32-1ade2225d2d6bf44399b37fd8411cd44a7fea99a.zip |
winansi: allow alternative screen buffer to be disabled
The alternative console screen buffer (used by less and vi) doesn't
work in Wine.
Setting the environment variable BB_ALT_BUFFER to 0 causes a screen
reset instead.
-rw-r--r-- | win32/winansi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/win32/winansi.c b/win32/winansi.c index fd0de8656..c13d021d2 100644 --- a/win32/winansi.c +++ b/win32/winansi.c | |||
@@ -110,8 +110,15 @@ static HANDLE dup_handle(HANDLE h) | |||
110 | static void use_alt_buffer(int flag) | 110 | static void use_alt_buffer(int flag) |
111 | { | 111 | { |
112 | static HANDLE console_orig = INVALID_HANDLE_VALUE; | 112 | static HANDLE console_orig = INVALID_HANDLE_VALUE; |
113 | const char *var; | ||
113 | HANDLE console, h; | 114 | HANDLE console, h; |
114 | 115 | ||
116 | var = getenv("BB_ALT_BUFFER"); | ||
117 | if (var && strcmp(var, "0") == 0) { | ||
118 | reset_screen(); | ||
119 | return; | ||
120 | } | ||
121 | |||
115 | if (flag) { | 122 | if (flag) { |
116 | SECURITY_ATTRIBUTES sa; | 123 | SECURITY_ATTRIBUTES sa; |
117 | CONSOLE_SCREEN_BUFFER_INFO sbi; | 124 | CONSOLE_SCREEN_BUFFER_INFO sbi; |