Skip to content

Commit 875608a

Browse files
authored
Merge pull request #8 from tucksaun/improve-color-support
Improve color support for some platforms
2 parents e57b04b + 14f2cd1 commit 875608a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

colors.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919

2020
package terminal
2121

22-
import "os"
22+
import (
23+
"os"
24+
"strings"
25+
)
2326

2427
func HasPosixColorSupport() bool {
25-
return os.Getenv("ANSICON") != "" || os.Getenv("ConEmuANSI") == "ON" || os.Getenv("TERM") == "xterm" || os.Getenv("SHLVL") != ""
28+
return os.Getenv("ANSICON") != "" || os.Getenv("ConEmuANSI") == "ON" || strings.HasPrefix(os.Getenv("TERM"), "xterm") || os.Getenv("TERM_PROGRAM") == "Hyper" || os.Getenv("SHLVL") != ""
2629
}

0 commit comments

Comments
 (0)