Adjusted Terminal Style Detection

Added check for COLORTERM environment variable.
pull/5508/head
Doug A 2019-10-01 00:57:55 -04:00
parent 7d59b0d36c
commit c9765993c9
1 changed files with 3 additions and 2 deletions

View File

@ -161,9 +161,10 @@ func wantsColor(fd uintptr) bool {
}
term := os.Getenv("TERM")
colorTerm := os.Getenv("COLORTERM")
// Example: term-256color
if !strings.Contains(term, "color") {
glog.Infof("TERM=%s, which probably does not support color", term)
if !strings.Contains(term, "color") && !strings.Contains(colorTerm, "truecolor") && !strings.Contains(colorTerm, "24bit") && !strings.Contains(colorTerm, "yes") {
glog.Infof("TERM=%s,COLORTERM=%s, which probably does not support color", term,colorTerm)
return false
}