jwalton / gchalk

Terminal string styling for go done right, with full and painless Windows 10 support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NO_COLOR is not respected

kkga opened this issue · comments

Trying to use this as a replacement for fatih/color, but it seems that NO_COLOR is not respected.

In the screencast below, the yellow lines are styled with gchalk, while the rest is fatih/color

The style i'm using is roughly like this:

styleHeading, err := gchalk.Style("yellow", "bold")

var sb = strings.Builder{}
sb.WriteString(styleHeading("some text"))
fmt.Println(sb.String())
record_2021-10-06-193917-comp.mp4

Fixed this in the "supportscolor" dependency. You should be able to upgrade with:

go get -u github.com/jwalton/gchalk

Or, if you rely on supportscolor directly:

go get -u github.com/jwalton/go-supportscolor