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

Issue 2739683005: [dart:io] Adds Platform.ansiSupported (Closed)

Created:
3 years, 9 months ago by zra
Modified:
3 years, 9 months ago
Reviewers:
sortie, siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

[dart:io] Adds Platform.ansiSupported This is so that flutter_tool can determine whether it can print ANSI codes to the terminal on windows. fixes #28614,#28984 R=asiva@google.com Committed: https://github.com/dart-lang/sdk/commit/a8bf498e5698c67676da3ab942ed3b51e88181a7

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address comments. Add a test. #

Patch Set 3 : Ensure console device is properly restored #

Patch Set 4 : Set the input code page #

Patch Set 5 : Cleanup #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -23 lines) Patch
M runtime/bin/io_natives.cc View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/platform.h View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/bin/platform.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/bin/platform_android.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/bin/platform_fuchsia.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/bin/platform_linux.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/bin/platform_macos.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/bin/platform_patch.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/bin/platform_unsupported.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/bin/platform_win.cc View 1 2 3 4 4 chunks +68 lines, -23 lines 1 comment Download
M sdk/lib/_internal/js_runtime/lib/io_patch.dart View 1 chunk +4 lines, -0 lines 0 comments Download
M sdk/lib/io/platform.dart View 2 chunks +9 lines, -0 lines 0 comments Download
M sdk/lib/io/platform_impl.dart View 2 chunks +2 lines, -0 lines 0 comments Download
A tests/standalone/io/ansi_supported_test.dart View 1 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (4 generated)
zra
3 years, 9 months ago (2017-03-10 22:50:08 UTC) #3
siva
lgtm https://codereview.chromium.org/2739683005/diff/1/runtime/bin/platform.cc File runtime/bin/platform.cc (right): https://codereview.chromium.org/2739683005/diff/1/runtime/bin/platform.cc#newcode114 runtime/bin/platform.cc:114: Dart_SetReturnValue(args, Dart_NewBoolean(Platform::AnsiSupported())); You could use Dart_SetBooleanReturnValue(args, Platform::AnsiSupported());
3 years, 9 months ago (2017-03-10 23:39:03 UTC) #4
zra
Committed patchset #5 (id:80001) manually as a8bf498e5698c67676da3ab942ed3b51e88181a7 (presubmit successful).
3 years, 9 months ago (2017-03-15 15:51:56 UTC) #6
zra
https://codereview.chromium.org/2739683005/diff/1/runtime/bin/platform.cc File runtime/bin/platform.cc (right): https://codereview.chromium.org/2739683005/diff/1/runtime/bin/platform.cc#newcode114 runtime/bin/platform.cc:114: Dart_SetReturnValue(args, Dart_NewBoolean(Platform::AnsiSupported())); On 2017/03/10 23:39:03, siva wrote: > You ...
3 years, 9 months ago (2017-03-15 17:03:57 UTC) #7
sortie
3 years, 9 months ago (2017-03-16 11:39:08 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/2739683005/diff/80001/runtime/bin/platform_wi...
File runtime/bin/platform_win.cc (right):

https://codereview.chromium.org/2739683005/diff/80001/runtime/bin/platform_wi...
runtime/bin/platform_win.cc:89: ansi_supported_ = false;
This looks like escape codes are considered unsupported if the input is not a
terminal, but support for escape codes only has to do with the console output. I
could imagine redirecting a file as input or using a pipe into a dart program
and still expect color output. There is no support for STD_ERROR_HANDLE here
either. The terminalness of the standard output and standard error are in
principle distinct and Platform should probably expose a different bool for
whether each of those support escape sequences.

Powered by Google App Engine
This is Rietveld 408576698