{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/28614","repository_url":"https://api.github.com/repos/dart-lang/sdk","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/28614/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/28614/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/28614/events","html_url":"https://github.com/dart-lang/sdk/issues/28614","id":204975446,"number":28614,"title":"Detect if Windows console has ANSI color support enabled","user":{"login":"goderbauer","id":1227763,"avatar_url":"https://avatars.githubusercontent.com/u/1227763?v=3","gravatar_id":"","url":"https://api.github.com/users/goderbauer","html_url":"https://github.com/goderbauer","followers_url":"https://api.github.com/users/goderbauer/followers","following_url":"https://api.github.com/users/goderbauer/following{/other_user}","gists_url":"https://api.github.com/users/goderbauer/gists{/gist_id}","starred_url":"https://api.github.com/users/goderbauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goderbauer/subscriptions","organizations_url":"https://api.github.com/users/goderbauer/orgs","repos_url":"https://api.github.com/users/goderbauer/repos","events_url":"https://api.github.com/users/goderbauer/events{/privacy}","received_events_url":"https://api.github.com/users/goderbauer/received_events","type":"User","site_admin":false},"labels":[{"id":219928184,"url":"https://api.github.com/repos/dart-lang/sdk/labels/area-library","name":"area-library","color":"c7def8","default":false},{"id":265663677,"url":"https://api.github.com/repos/dart-lang/sdk/labels/Customer-Flutter","name":"Customer-Flutter","color":"006b75","default":false},{"id":219928199,"url":"https://api.github.com/repos/dart-lang/sdk/labels/library-io","name":"library-io","color":"d4c5f9","default":false},{"id":219928158,"url":"https://api.github.com/repos/dart-lang/sdk/labels/P1%20high","name":"P1 high","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-02-02T19:42:39Z","updated_at":"2017-02-05T12:11:20Z","closed_at":null,"body":"With Windows 10, Microsoft added support for ANSI escape codes [1] to the console. With these codes, the user can print text in various colors to the console.\r\n\r\nBefore these codes can be used, it should be checked if they are actually supported by the terminal (using them in an unsupported terminal yields unreadable output). According to Microsoft, the `GetConsoleMode` API [3] should be used to check if `ENABLE_VIRTUAL_TERMINAL_PROCESSING` is set to determine the terminal's ANSI escape code support.\r\n\r\nUnfortunately, I can't find a way to check from Dart if ANSI escape codes are supported on Windows or not. Is there a way? If not, can it be added?\r\n\r\n[1] https://en.wikipedia.org/wiki/ANSI_escape_code\r\n[2] https://msdn.microsoft.com/en-us/library/windows/desktop/mt638032(v=vs.85).aspx\r\n[3] https://msdn.microsoft.com/en-us/library/windows/desktop/ms683167(v=vs.85).aspx"},"comment":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/comments/277515809","html_url":"https://github.com/dart-lang/sdk/issues/28614#issuecomment-277515809","issue_url":"https://api.github.com/repos/dart-lang/sdk/issues/28614","id":277515809,"user":{"login":"lrhn","id":4865287,"avatar_url":"https://avatars.githubusercontent.com/u/4865287?v=3","gravatar_id":"","url":"https://api.github.com/users/lrhn","html_url":"https://github.com/lrhn","followers_url":"https://api.github.com/users/lrhn/followers","following_url":"https://api.github.com/users/lrhn/following{/other_user}","gists_url":"https://api.github.com/users/lrhn/gists{/gist_id}","starred_url":"https://api.github.com/users/lrhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrhn/subscriptions","organizations_url":"https://api.github.com/users/lrhn/orgs","repos_url":"https://api.github.com/users/lrhn/repos","events_url":"https://api.github.com/users/lrhn/events{/privacy}","received_events_url":"https://api.github.com/users/lrhn/received_events","type":"User","site_admin":false},"created_at":"2017-02-05T12:11:19Z","updated_at":"2017-02-05T12:11:19Z","body":"Only if it's something we can support on other platforms too, and if it makes sense.\r\nDetecting whether ANSI escape sequences are supported is - tricky. A simple yes/no answer won't cover the actual complexity of which features are supported, and how to use them.\r\n\r\nI'm not sure we want to get into the complexity of termcaps, or implement a full termcap-based library (like ncurses) in `dart:io`.\r\n"}}
{"actor":{"display_login":"lrhn"}}