Chromium Code Reviews| Index: runtime/bin/stdio_patch.dart |
| diff --git a/runtime/bin/stdio_patch.dart b/runtime/bin/stdio_patch.dart |
| index e537dc87212029c4cb756032c4949d545cdb1897..d33fbc2123d23a8d5cde76abe967abc5423af367 100644 |
| --- a/runtime/bin/stdio_patch.dart |
| +++ b/runtime/bin/stdio_patch.dart |
| @@ -83,11 +83,20 @@ |
| } |
| } |
| + @patch bool get supportsAnsiEscapes { |
| + var result = _supportsAnsiEscapes(); |
| + if (result is OSError) { |
| + throw new StdinException("Error determining ANSI support", result); |
| + } |
| + return result; |
| + } |
| + |
| static _echoMode() native "Stdin_GetEchoMode"; |
| static _setEchoMode(bool enabled) native "Stdin_SetEchoMode"; |
| static _lineMode() native "Stdin_GetLineMode"; |
| static _setLineMode(bool enabled) native "Stdin_SetLineMode"; |
| static _readByte() native "Stdin_ReadByte"; |
| + static _supportsAnsiEscapes() native "Stdin_AnsiSupported"; |
| } |
| @patch class Stdout { |
| @@ -112,6 +121,16 @@ |
| } |
| static _getTerminalSize(int fd) native "Stdout_GetTerminalSize"; |
| + |
| + @patch static bool _supportsAnsiEscapes(int fd) { |
| + var result = _getAnsiSupported(fd); |
| + if (result is! bool) { |
| + throw new StdoutException("Error determining ANSI support", result); |
|
siva
2017/03/17 23:54:24
Would it make sense to include the 'fd' in the exc
|
| + } |
| + return result; |
| + } |
| + |
| + static _getAnsiSupported(int fd) native "Stdout_AnsiSupported"; |
| } |