Description
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.
Implementing 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.
Implementing 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.
Then 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.
Implementing this ourselves would require a system call which I would rather stay away from.
We could just implement it 'incorrectly' and have auto to be the same as never or the same as always.
What do you think?