File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
packages/flutter_tools/lib/src/base Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,11 @@ If (Test-Path Env:\FLUTTER_ANSI_TERMINAL) { Remove-Item Env:\FLUTTER_ANSI_TERMIN
18
18
$stdout = [Win32.NativeMethods ]::GetStdHandle(-11 ) # STD_OUTPUT_HANDLE
19
19
If ($stdout -ne -1 ) {
20
20
$mode = 0
21
- $result = [Win32.NativeMethods ]::GetConsoleMode($stdout , [ref ]$mode )
22
- If ($result ) {
21
+ If ([Win32.NativeMethods ]::GetConsoleMode($stdout , [ref ]$mode )) {
23
22
$mode = $mode -bor 4 # ENABLE_VIRTUAL_TERMINAL_PROCESSING
24
- $env: FLUTTER_ANSI_TERMINAL = [Win32.NativeMethods ]::SetConsoleMode($stdout , $mode )
23
+ If ([Win32.NativeMethods ]::SetConsoleMode($stdout , $mode )) {
24
+ $env: FLUTTER_ANSI_TERMINAL = " true"
25
+ }
25
26
}
26
27
}
27
28
Original file line number Diff line number Diff line change @@ -245,8 +245,8 @@ class AnsiTerminal {
245
245
AnsiTerminal () {
246
246
String term = platform.environment['TERM' ];
247
247
// FLUTTER_ANSI_TERMINAL is a work-around for https://github.com/dart-lang/sdk/issues/28614
248
- String flutterAnsiTerm = platform.environment[ 'FLUTTER_ANSI_TERMINAL' ] ;
249
- supportsColor = (term != null && term != 'dumb' ) || ( flutterAnsiTerm != null ) ;
248
+ bool flutterAnsiTerm = platform.environment. containsKey ( 'FLUTTER_ANSI_TERMINAL' ) ;
249
+ supportsColor = (term != null && term != 'dumb' ) || flutterAnsiTerm;
250
250
}
251
251
252
252
static const String KEY_F1 = '\u 001BOP' ;
You can’t perform that action at this time.
0 commit comments