diff --git a/CHANGELOG.md b/CHANGELOG.md index 418f0a0..582bbd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### 1.1.0-g3 + +* Added `stdinSupportsAnsi` and `stdinSupportsAnsi` +* Removed `ansiSupported` + ### 1.1.0 * Added `ansiSupported` diff --git a/lib/src/interface/local_platform.dart b/lib/src/interface/local_platform.dart index 178c683..1063205 100644 --- a/lib/src/interface/local_platform.dart +++ b/lib/src/interface/local_platform.dart @@ -48,5 +48,8 @@ class LocalPlatform extends Platform { String get version => io.Platform.version; @override - bool get ansiSupported => io.Platform.ansiSupported; + bool get stdinSupportsAnsi => io.Platform.ansiSupported; + + @override + bool get stdoutSupportsAnsi => io.Platform.ansiSupported; } diff --git a/lib/src/interface/platform.dart b/lib/src/interface/platform.dart index a603e3c..c750108 100644 --- a/lib/src/interface/platform.dart +++ b/lib/src/interface/platform.dart @@ -114,11 +114,11 @@ abstract class Platform { /// whitespace and other version and build details. String get version; - /// When stdio is connected to a terminal, whether ANSI codes are supported. - /// - /// This value is hard-coded to true, except on Windows where only more recent - /// versions of Windows 10 support the codes. - bool get ansiSupported; + /// When stdin is connected to a terminal, whether ANSI codes are supported. + bool get stdinSupportsAnsi; + + /// When stdout is connected to a terminal, whether ANSI codes are supported. + bool get stdoutSupportsAnsi; /// Returns a JSON-encoded representation of this platform. String toJson() { @@ -135,7 +135,8 @@ abstract class Platform { 'packageRoot': packageRoot, 'packageConfig': packageConfig, 'version': version, - 'ansiSupported': ansiSupported, + 'stdinSupportsAnsi': stdinSupportsAnsi, + 'stdoutSupportsAnsi': stdoutSupportsAnsi, }); } } diff --git a/lib/src/testing/fake_platform.dart b/lib/src/testing/fake_platform.dart index 04df6fe..6b039f6 100644 --- a/lib/src/testing/fake_platform.dart +++ b/lib/src/testing/fake_platform.dart @@ -25,7 +25,8 @@ class FakePlatform extends Platform { this.packageRoot, this.packageConfig, this.version, - this.ansiSupported, + this.stdinSupportsAnsi, + this.stdoutSupportsAnsi, }); /// Creates a new [FakePlatform] with properties whose initial values mirror @@ -43,7 +44,8 @@ class FakePlatform extends Platform { packageRoot = platform.packageRoot, packageConfig = platform.packageConfig, version = platform.version, - ansiSupported = platform.ansiSupported; + stdinSupportsAnsi = platform.stdinSupportsAnsi, + stdoutSupportsAnsi = platform.stdoutSupportsAnsi; /// Creates a new [FakePlatform] with properties extracted from the encoded /// JSON string. @@ -65,7 +67,8 @@ class FakePlatform extends Platform { packageRoot : map['packageRoot'], packageConfig : map['packageConfig'], version : map['version'], - ansiSupported: map['ansiSupported'], + stdinSupportsAnsi: map['stdinSupportsAnsi'], + stdoutSupportsAnsi: map['stdoutSupportsAnsi'], ); } @@ -106,5 +109,8 @@ class FakePlatform extends Platform { String version; @override - bool ansiSupported; + bool stdinSupportsAnsi; + + @override + bool stdoutSupportsAnsi; } diff --git a/pubspec.yaml b/pubspec.yaml index af6d799..6a69447 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: platform -version: 1.1.0 +version: 1.1.0-g3 authors: - Todd Volkert description: A pluggable, mockable platform abstraction for Dart.