Chromium Code Reviews| Index: pkg/front_end/lib/src/fasta/colors.dart |
| diff --git a/pkg/front_end/lib/src/fasta/colors.dart b/pkg/front_end/lib/src/fasta/colors.dart |
| index 6f3214dca91430c06f29dd9fa30b0fdfdc5e53ce..f3891b917d50387f3ccdc2b196cefd395f55e936 100644 |
| --- a/pkg/front_end/lib/src/fasta/colors.dart |
| +++ b/pkg/front_end/lib/src/fasta/colors.dart |
| @@ -98,9 +98,9 @@ String white(String string) => wrap(string, WHITE_COLOR); |
| /// Note: do not call this method directly, as it is expensive to |
| /// compute. Instead, use [CompilerContext.enableColors]. |
| bool computeEnableColors(CompilerContext context) { |
| - if (Platform.isWindows) { |
| + if (!Platform.ansiSupported) { |
| if (context.options.verbose) { |
| - print("Not enabling colors, running on Windows."); |
| + print("Not enabling colors, 'Platform.ansiSupported' is false."); |
| } |
| return false; |
| } |
| @@ -119,6 +119,16 @@ bool computeEnableColors(CompilerContext context) { |
| return false; |
| } |
| + if (Platform.isWindows) { |
| + if (context.options.verbose) { |
| + print("Enabling colors as OS is Windows."); |
| + } |
| + return true; |
| + } |
| + |
| + // We have to check if the terminal actually supports colors. Currently, |
| + // `Platform.ansiSupported` is hard-coded to true on non-Windows platforms. |
|
sortie
2017/03/16 10:32:03
This comment may get out of date in the future. Yo
ahe
2017/03/16 11:06:29
I normally expect that people look in the revision
|
| + |
| // The `-S` option of `tput` allows us to query multiple capabilities at |
| // once. |
| ProcessResult result = Process.runSync( |