{"action":"created","issue":{"url":"https://api.github.com/repos/Stebalien/term/issues/56","labels_url":"https://api.github.com/repos/Stebalien/term/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/Stebalien/term/issues/56/comments","events_url":"https://api.github.com/repos/Stebalien/term/issues/56/events","html_url":"https://github.com/Stebalien/term/pull/56","id":130039658,"number":56,"title":"Add support check functions.","user":{"login":"Stebalien","id":310393,"avatar_url":"https://avatars.githubusercontent.com/u/310393?v=3","gravatar_id":"","url":"https://api.github.com/users/Stebalien","html_url":"https://github.com/Stebalien","followers_url":"https://api.github.com/users/Stebalien/followers","following_url":"https://api.github.com/users/Stebalien/following{/other_user}","gists_url":"https://api.github.com/users/Stebalien/gists{/gist_id}","starred_url":"https://api.github.com/users/Stebalien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stebalien/subscriptions","organizations_url":"https://api.github.com/users/Stebalien/orgs","repos_url":"https://api.github.com/users/Stebalien/repos","events_url":"https://api.github.com/users/Stebalien/events{/privacy}","received_events_url":"https://api.github.com/users/Stebalien/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-30T21:29:06Z","updated_at":"2016-01-31T08:10:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Stebalien/term/pulls/56","html_url":"https://github.com/Stebalien/term/pull/56","diff_url":"https://github.com/Stebalien/term/pull/56.diff","patch_url":"https://github.com/Stebalien/term/pull/56.patch"},"body":"This makes it easy to determine if the terminal supports color.\r\n\r\n/cc @cmr, @alexcrichton\r\n\r\nThis is part of fixing https://github.com/rust-lang/cargo/issues/2338#issuecomment-177268195.\r\n\r\nThe terminals in question do not support color. We used to return `Ok(false)` when a program tried to use an unsupported attribute but we now return an error (`Err(Error::NotSupported)`). This patch makes it possible to check `supports_color` up front to avoid running into this issue.\r\n\r\nI'm asking for a review because I don't know if supports_color should imply supports_reset or if we should have the programmer call `supports_reset() && supports_color()`. Can you think of any cases where one might care about supporting terminals that support color but not resetting those colors to their defaults? Do any such terminals even exist?\r\n\r\nOnce I get this merged and I cut yet another release, cargo can call `term.supports_color()` after creating the terminal to make sure the terminal will actually be useful."},"comment":{"url":"https://api.github.com/repos/Stebalien/term/issues/comments/177429709","html_url":"https://github.com/Stebalien/term/pull/56#issuecomment-177429709","issue_url":"https://api.github.com/repos/Stebalien/term/issues/56","id":177429709,"user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"created_at":"2016-01-31T08:10:55Z","updated_at":"2016-01-31T08:10:55Z","body":"Seems reasonable to me!"}}