{"action":"created","issue":{"url":"https://api.github.com/repos/Jguer/yay/issues/224","repository_url":"https://api.github.com/repos/Jguer/yay","labels_url":"https://api.github.com/repos/Jguer/yay/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/Jguer/yay/issues/224/comments","events_url":"https://api.github.com/repos/Jguer/yay/issues/224/events","html_url":"https://github.com/Jguer/yay/issues/224","id":303607799,"number":224,"title":"Support --colour","user":{"login":"Morganamilo","id":16593899,"avatar_url":"https://avatars2.githubusercontent.com/u/16593899?v=4","gravatar_id":"","url":"https://api.github.com/users/Morganamilo","html_url":"https://github.com/Morganamilo","followers_url":"https://api.github.com/users/Morganamilo/followers","following_url":"https://api.github.com/users/Morganamilo/following{/other_user}","gists_url":"https://api.github.com/users/Morganamilo/gists{/gist_id}","starred_url":"https://api.github.com/users/Morganamilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morganamilo/subscriptions","organizations_url":"https://api.github.com/users/Morganamilo/orgs","repos_url":"https://api.github.com/users/Morganamilo/repos","events_url":"https://api.github.com/users/Morganamilo/events{/privacy}","received_events_url":"https://api.github.com/users/Morganamilo/received_events","type":"User","site_admin":false},"labels":[{"id":436690127,"url":"https://api.github.com/repos/Jguer/yay/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":836453940,"url":"https://api.github.com/repos/Jguer/yay/labels/low%20priority","name":"low priority","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-08T19:47:44Z","updated_at":"2018-03-10T02:43:16Z","closed_at":null,"author_association":"COLLABORATOR","body":"For the sake of consistency I would like Yay to support the same colour flags as pacman `--color always|auto|never`. Currently Yay reads the colour setting from pacman's config but is totally unaffected by the flags.\r\n\r\nImplementing `always` and `never` is pretty straightforward. `auto` on the other hand checks if we are outputting to a terminal and only enables colour if we are.\r\n\r\nImplementing this is a little more difficult. The best way I can see to do that is to pull in a new dependency: http://golang.org/x/crypto/ssh/terminal. It's not part of the standard library but it is at least from golang.org.\r\n\r\nThen again a whole dependency for a tiny feature? It does kind of seem like a waste. I know we're trying to keep dependencies to a minimum.\r\n\r\nImplementing this ourselves would require a system call which I would rather stay away from.\r\n\r\nWe could just implement it 'incorrectly' and have auto to be the same as never or the same as always.\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/Jguer/yay/issues/comments/371996405","html_url":"https://github.com/Jguer/yay/issues/224#issuecomment-371996405","issue_url":"https://api.github.com/repos/Jguer/yay/issues/224","id":371996405,"user":{"login":"Morganamilo","id":16593899,"avatar_url":"https://avatars2.githubusercontent.com/u/16593899?v=4","gravatar_id":"","url":"https://api.github.com/users/Morganamilo","html_url":"https://github.com/Morganamilo","followers_url":"https://api.github.com/users/Morganamilo/followers","following_url":"https://api.github.com/users/Morganamilo/following{/other_user}","gists_url":"https://api.github.com/users/Morganamilo/gists{/gist_id}","starred_url":"https://api.github.com/users/Morganamilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morganamilo/subscriptions","organizations_url":"https://api.github.com/users/Morganamilo/orgs","repos_url":"https://api.github.com/users/Morganamilo/repos","events_url":"https://api.github.com/users/Morganamilo/events{/privacy}","received_events_url":"https://api.github.com/users/Morganamilo/received_events","type":"User","site_admin":false},"created_at":"2018-03-10T02:43:16Z","updated_at":"2018-03-10T02:43:16Z","author_association":"COLLABORATOR","body":"As I mentioned in my initial post I did consider the syscall option. My problems with a syscall is that I don't really think high level applications should be making syscalls, that's the standard library's  job. Also I don't really want to be importing unsafe outside of go-alpm.\r\n\r\nAnother thing is that syscalls are OS specific. Pacman is OS agnostic so I think Yay should at least try to be too. Not that I have tried Yay on another OS or really expect much of an user base there, I have no idea what the user numbers are for projects like Arch Hurd and pacBSD. \r\n\r\nhttp://golang.org/x/crypto/ssh/terminal provides implementations for BSD and a couple others at least. But doing all that just for colour settings seems like a bit much."}}
{"actor":{"display_login":"Morganamilo"}}