Skip to content

Commit 03cb08b

Browse files
committed
Improve color support for xterm compatible terminals
1 parent 7bd1512 commit 03cb08b

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("SHLVL") != ""
2629
}

0 commit comments

Comments
 (0)