Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
a559b8df
Commit
a559b8df
authored
Apr 05, 2017
by
Michael Goderbauer
Committed by
GitHub
Apr 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Regression] Re-enable ANSI color support on Windows (#9232)
Also adds a test to make sure we don't break it again.
parent
03f5793c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
13 deletions
+25
-13
pubspec.yaml
dev/devicelab/pubspec.yaml
+1
-1
logger.dart
packages/flutter_tools/lib/src/base/logger.dart
+1
-10
pubspec.yaml
packages/flutter_tools/pubspec.yaml
+2
-2
logger_test.dart
packages/flutter_tools/test/src/base/logger_test.dart
+21
-0
No files found.
dev/devicelab/pubspec.yaml
View file @
a559b8df
...
@@ -11,7 +11,7 @@ dependencies:
...
@@ -11,7 +11,7 @@ dependencies:
args
:
^0.13.4
args
:
^0.13.4
meta
:
^1.0.4
meta
:
^1.0.4
path
:
^1.4.0
path
:
^1.4.0
process
:
2.0.
1
process
:
2.0.
3
stack_trace
:
^1.4.0
stack_trace
:
^1.4.0
vm_service_client
:
'
0.2.2+4'
vm_service_client
:
'
0.2.2+4'
...
...
packages/flutter_tools/lib/src/base/logger.dart
View file @
a559b8df
...
@@ -248,15 +248,6 @@ enum _LogType {
...
@@ -248,15 +248,6 @@ enum _LogType {
}
}
class
AnsiTerminal
{
class
AnsiTerminal
{
AnsiTerminal
()
{
if
(
platform
.
isWindows
)
{
supportsColor
=
platform
.
ansiSupported
;
}
else
{
final
String
term
=
platform
.
environment
[
'TERM'
];
supportsColor
=
(
term
!=
null
&&
term
!=
'dumb'
);
}
}
static
const
String
_bold
=
'
\
u001B[1m'
;
static
const
String
_bold
=
'
\
u001B[1m'
;
static
const
String
_reset
=
'
\
u001B[0m'
;
static
const
String
_reset
=
'
\
u001B[0m'
;
static
const
String
_clear
=
'
\
u001B[2J
\
u001B[H'
;
static
const
String
_clear
=
'
\
u001B[2J
\
u001B[H'
;
...
@@ -275,7 +266,7 @@ class AnsiTerminal {
...
@@ -275,7 +266,7 @@ class AnsiTerminal {
_INVALID_HANDLE
,
_INVALID_HANDLE
,
];
];
bool
supportsColor
;
bool
supportsColor
=
platform
.
stdoutSupportsAnsi
;
String
bolden
(
String
message
)
{
String
bolden
(
String
message
)
{
if
(!
supportsColor
)
if
(!
supportsColor
)
...
...
packages/flutter_tools/pubspec.yaml
View file @
a559b8df
...
@@ -22,8 +22,8 @@ dependencies:
...
@@ -22,8 +22,8 @@ dependencies:
meta
:
^1.0.4
meta
:
^1.0.4
mustache
:
^0.2.5
mustache
:
^0.2.5
package_config
:
'
>=0.1.5
<2.0.0'
package_config
:
'
>=0.1.5
<2.0.0'
platform
:
1.1.1
platform
:
2.0.0
process
:
2.0.
1
process
:
2.0.
3
quiver
:
^0.24.0
quiver
:
^0.24.0
stack_trace
:
^1.4.0
stack_trace
:
^1.4.0
usage
:
^3.0.1
usage
:
^3.0.1
...
...
packages/flutter_tools/test/src/base/logger_test.dart
0 → 100644
View file @
a559b8df
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/os.dart'
;
import
'package:flutter_tools/src/base/version.dart'
;
import
'package:test/test.dart'
;
void
main
(
)
{
group
(
'AnsiLogger'
,
()
{
test
(
'should support color on Windows version >= 10.0.10586'
,
()
{
final
String
name
=
new
OperatingSystemUtils
().
name
;
final
String
versionString
=
new
RegExp
(
r'\d+\.\d+\.\d+'
).
firstMatch
(
name
).
group
(
0
);
final
Version
version
=
new
Version
.
parse
(
versionString
);
final
bool
shouldSupportColor
=
version
>=
new
Version
.
parse
(
'10.0.10586'
);
expect
(
new
AnsiTerminal
().
supportsColor
,
shouldSupportColor
);
},
testOn:
'windows'
);
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment