mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 11:58:13 +00:00
[dart:io][windows] Stdout.supportsAnsiEscapes is false when not connected to a terminal
Review-Url: https://codereview.chromium.org/2760503003 .
This commit is contained in:
parent
9af5996380
commit
8fdab25117
|
@ -92,12 +92,12 @@ bool Stdin::AnsiSupported(bool* supported) {
|
|||
HANDLE h = GetStdHandle(STD_INPUT_HANDLE);
|
||||
if (h == INVALID_HANDLE_VALUE) {
|
||||
*supported = false;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
DWORD mode;
|
||||
if (!GetConsoleMode(h, &mode)) {
|
||||
*supported = false;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
*supported = (mode & ENABLE_VIRTUAL_TERMINAL_INPUT) != 0;
|
||||
return true;
|
||||
|
@ -131,12 +131,12 @@ bool Stdout::AnsiSupported(intptr_t fd, bool* supported) {
|
|||
}
|
||||
if (h == INVALID_HANDLE_VALUE) {
|
||||
*supported = false;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
DWORD mode;
|
||||
if (!GetConsoleMode(h, &mode)) {
|
||||
*supported = false;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
*supported = (mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) != 0;
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue