Enable ANSI codes in PowerShell (#8537)

This commit is contained in:
Michael Goderbauer
2017-03-02 13:09:36 -08:00
committed by GitHub
parent e55c7239ec
commit 1f7b8ae11f
2 changed files with 32 additions and 2 deletions

View File

@@ -243,9 +243,10 @@ enum _LogType {
class AnsiTerminal {
AnsiTerminal() {
// TODO(devoncarew): This detection does not work for Windows (https://github.com/dart-lang/sdk/issues/28614).
String term = platform.environment['TERM'];
supportsColor = term != null && term != 'dumb';
// FLUTTER_ANSI_TERMINAL is a work-around for https://github.com/dart-lang/sdk/issues/28614
String flutterAnsiTerm = platform.environment['FLUTTER_ANSI_TERMINAL'];
supportsColor = (term != null && term != 'dumb') || (flutterAnsiTerm != null);
}
static const String KEY_F1 = '\u001BOP';