kevincobain2000 / gobrew

Go version manager, written in Go. Super simple tool to install and manage Go versions. Install go without root. Gobrew doesn't require shell rehash.
https://medium.com/web-developer/go-version-manager-gobrew-c8750157dfe6
MIT License
364 stars 24 forks source link

Hard to read output in light scheme colors #102

Closed Zerpet closed 1 year ago

Zerpet commented 1 year ago

Description

When the system color scheme is set to light, the output of gobrew is hard to read because it outputs in yellow font color. This is on a M1 Mac, but I think it will be a problem for Linux users as well. See the below screenshot:

Screenshot 2023-05-09 at 09 25 16

Possible solutions

We could try to change the color output based on system color scheme. I haven't researched how to do this in Go, but I hope this is a solved problem across different platforms 🙂

Another solution would be to make the color output configurable.

I'm happy to contribute a PR.

kevincobain2000 commented 1 year ago

That should be easy fix. Thanks for reporting.

juev commented 1 year ago

Another solution would be to make the color output configurable.

Maybe we can use new flag, for example nocolor? Or use nocolor as default, and add color flag for output with colors?

I like this idea.

kevincobain2000 commented 1 year ago

I think we can simply check the term color via termenv as output.HasDarkBackground() and set colors according to that

https://github.com/kevincobain2000/gobrew/blob/d1918ffab828d5b402d8b8c5e3cc333b6b7ff0b8/utils/utils.go#L14-L18

kevincobain2000 commented 1 year ago

How about this? https://github.com/kevincobain2000/gobrew/pull/103