Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Unified Diff: sdk/lib/io/platform.dart

Issue 2739683005: [dart:io] Adds Platform.ansiSupported (Closed)
Patch Set: Cleanup Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/io/platform.dart
diff --git a/sdk/lib/io/platform.dart b/sdk/lib/io/platform.dart
index 75f7ffd0e46b49bc7e0d9cbe574af6ce8f5d8c2e..242f6bbc2d969ff717cb36c494238bb0b3a20b67 100644
--- a/sdk/lib/io/platform.dart
+++ b/sdk/lib/io/platform.dart
@@ -71,6 +71,7 @@ class Platform {
static final _operatingSystem = _Platform.operatingSystem;
static final _localHostname = _Platform.localHostname;
static final _version = _Platform.version;
+ static final _ansiSupported = _Platform.ansiSupported;
/**
* Get the number of processors of the machine.
@@ -124,6 +125,14 @@ class Platform {
*/
static final bool isFuchsia = (_operatingSystem == "fuchsia");
+ /**
+ * 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.
+ */
+ static final bool ansiSupported = _ansiSupported;
+
/**
* Get the environment for this process.
*

Powered by Google App Engine
This is Rietveld 408576698