fatih/color

Background color overflows on terminal scroll

frax opened this issue · 1 comments

frax commented

And by overflow I mean expands the full line. Is there anyway I can avoid this?

TERM=xterm-256color and I have tried in both iTerm and Terminal, bash and zsh. Latest macOS Big Sur and go 1.16.3.
bash behaves a little different but still kinda the same bug.

Here's a simple example, run it a few times from the terminal.

import (
	"github.com/fatih/color"
)

func main() {
	c := color.New(color.FgCyan).Add(color.BgRed)
	c.Println("meep")
	c.Println("meep")
	c.Println("meep")
	c.Println("meep")
}

Screenshot 2021-04-11 at 18 04 37

fatih commented

Hi @frax

I'm not sure what the proper fix would be here. I'm using Tmux and Fish, and for me, it doesn't do it. I think it might be related to your Terminal settings.

Another suggestion would be to use c.Print() instead of c.Println().