color
color copied to clipboard
Printf does not color the entire string
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:
Konsole:
Additional context
I also tried this on Konsole and i have encountered the same issue.