{"action":"created","issue":{"url":"https://api.github.com/repos/chalk/supports-color/issues/29","labels_url":"https://api.github.com/repos/chalk/supports-color/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/chalk/supports-color/issues/29/comments","events_url":"https://api.github.com/repos/chalk/supports-color/issues/29/events","html_url":"https://github.com/chalk/supports-color/issues/29","id":97344238,"number":29,"title":"Use terminfo database for systems providing the `TERM` environment variable","user":{"login":"Qix-","id":885648,"avatar_url":"https://avatars.githubusercontent.com/u/885648?v=3","gravatar_id":"","url":"https://api.github.com/users/Qix-","html_url":"https://github.com/Qix-","followers_url":"https://api.github.com/users/Qix-/followers","following_url":"https://api.github.com/users/Qix-/following{/other_user}","gists_url":"https://api.github.com/users/Qix-/gists{/gist_id}","starred_url":"https://api.github.com/users/Qix-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qix-/subscriptions","organizations_url":"https://api.github.com/users/Qix-/orgs","repos_url":"https://api.github.com/users/Qix-/repos","events_url":"https://api.github.com/users/Qix-/events{/privacy}","received_events_url":"https://api.github.com/users/Qix-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-26T19:40:15Z","updated_at":"2015-07-26T23:43:22Z","closed_at":null,"body":"`TERM` has an endless list of possible values:\r\n\r\n<img width=\"635\" alt=\"screen shot 2015-07-26 at 1 08 14 pm\" src=\"https://cloud.githubusercontent.com/assets/885648/8895436/6b07a482-3397-11e5-98ef-e1db350b0434.png\">\r\n\r\nThe *correct* way would be to look up the terminal information given the `TERM` environment variable and see what capabilities the terminal has. This includes what kind of underline/overline it has, whether or not the terminal supports color at all, how many colors it supports, and (if I read the man page correctly) even the escape character that should be used.\r\n\r\nI understand a lot of that information isn't pertinent to `supports-color` specifically, but the color support bits do.\r\n\r\nCurrently, we're just testing for a few of the common `TERM` values via regex."},"comment":{"url":"https://api.github.com/repos/chalk/supports-color/issues/comments/125048546","html_url":"https://github.com/chalk/supports-color/issues/29#issuecomment-125048546","issue_url":"https://api.github.com/repos/chalk/supports-color/issues/29","id":125048546,"user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"created_at":"2015-07-26T23:43:22Z","updated_at":"2015-07-26T23:43:22Z","body":"I've considered it in the past, but I went with the simple and practical way instead. What's the benfit of doing this? What kind of color support does it return? Do you have an example? I really don't want to spawn to get this information, is there a way to get what we need by embedding the relevant parts of the `terminfo` DB or something?"}}