fatih / color

Color package for Go (golang)
https://pkg.go.dev/github.com/fatih/color
MIT License
7.17k stars 610 forks source link

printing colorString() does not print color #174

Closed thocunningham closed 1 year ago

thocunningham commented 1 year ago

In windows command prompt and powershell, using any colorString function (e.g. HiGreenString) and printing it will not result in a colored output.

This can be reproduced with:

package main

import (
    "fmt"

    "github.com/fatih/color"
)

func main() {
    fmt.Println("version:", color.HiGreenString("1.0.0"))

    fmt.Print("version: ")
    color.HiGreen("1.0.0")
}

When running these are the results:

version: ←[31m1.0.0←[0m
version: 1.0.0