Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background color overflows on terminal scroll #135

Closed
frax opened this issue Apr 11, 2021 · 1 comment
Closed

Background color overflows on terminal scroll #135

frax opened this issue Apr 11, 2021 · 1 comment

Comments

@frax
Copy link

frax commented Apr 11, 2021

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
Copy link
Owner

fatih commented Apr 24, 2021

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().

@fatih fatih closed this as completed Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants