diff --git a/src/ansi_color.go b/src/ansi_color.go index ca7dec1a..f01320ff 100644 --- a/src/ansi_color.go +++ b/src/ansi_color.go @@ -92,6 +92,10 @@ func (a *AnsiColor) getAnsiFromColorString(colorString string, isBackground bool } func (a *AnsiColor) writeColoredText(background, foreground, text string) { + // Avoid emitting empty strings with color codes + if text == "" { + return + } var coloredText string if foreground == Transparent && background != "" { ansiColor := a.getAnsiFromColorString(background, false)