color icon indicating copy to clipboard operation
color copied to clipboard

Printf does not color the entire string

Open luca-patrignani opened this issue 1 year ago • 0 comments

System (please complete the following information):

  • OS: Kubuntu 22.04.2 LTS x86_64
  • GO Version: 1.20.4
  • Pkg Version: v1.5.4

ENV info on the terminal (by command env | grep -i TERM) TERM_PROGRAM_VERSION=1.80.0 COLORTERM=truecolor TERM=xterm-256color TERM_PROGRAM=vscode

Describe the bug

When Printf recieves a "colored" string as argument it does not colors the part of string after %s.

To Reproduce

package main

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

func main() {
	color.FgRed.Printf("first %s third\n", color.FgYellow.Render("second"));
}

Expected behavior

I would expect that "first" and "third" will be colored in red, second in yellow. Instead first is colored in red, second in yellow and third in white

Screenshots VS Code integrated terminal: Screenshot_20230806_135419 Konsole: Screenshot_20230806_135535 Additional context I also tried this on Konsole and i have encountered the same issue.

luca-patrignani avatar Aug 06 '23 12:08 luca-patrignani