File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
sdk/lib/_internal/pub/lib/src Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -590,12 +590,18 @@ String libraryPath(String libraryName) {
590
590
return path.fromUri (lib.uri);
591
591
}
592
592
593
- /// Gets a "special" string (ANSI escape or Unicode). On Windows, returns
594
- /// something else since those aren't supported.
593
+ /// Gets a "special" string (ANSI escape or Unicode).
594
+ ///
595
+ /// On Windows or when not printing to a terminal, returns something else since
596
+ /// those aren't supported.
595
597
String getSpecial (String color, [String onWindows = '' ]) {
596
598
// No ANSI escapes on windows or when running tests.
597
- if (runningAsTest || Platform .operatingSystem == 'windows' ) return onWindows;
598
- return color;
599
+ if (runningAsTest || Platform .operatingSystem == 'windows' ||
600
+ stdioType (stdout) != StdioType .TERMINAL ) {
601
+ return onWindows;
602
+ } else {
603
+ return color;
604
+ }
599
605
}
600
606
601
607
/// Prepends each line in [text] with [prefix] . If [firstPrefix] is passed, the
You can’t perform that action at this time.
0 commit comments