fatih / color

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

Background colors not clearing properly after newline #58

Closed jbsmith7741 closed 7 years ago

jbsmith7741 commented 7 years ago

Background color don't properly clear if using Println or Printf

func TestLineClear(t *testing.T) {
    New(BgWhite).Printf("Printf - Solid white\n")
    fmt.Println("Line should be normal")
    fmt.Println()

    New(BgWhite).Println("Println - Solid white")
    fmt.Println("Line should be normal")
    fmt.Println()

    New(BgWhite).Print("Print - Solid white\n")
    fmt.Println("Line should be normal")
}

screen shot 2017-02-13 at 2 09 29 pm

fatih commented 7 years ago

I think it has to do with the terminal. This is how iterm2 shows it:

screen shot 2017-02-14 at 2 07 30 am

What terminal are you using? I think think this is caused by something else.

jbsmith7741 commented 7 years ago

I'm using Terminal 2.7.1 (388) on a Macbook pro running Sierra 10.12.3