From e4573fd0ce851d761a0b63131eb03acfc04d2846 Mon Sep 17 00:00:00 2001 From: Karl Matthias Date: Mon, 22 Jul 2024 18:54:38 +0100 Subject: [PATCH 1/2] Support all xterm variants with color --- convey/reporting/init.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/convey/reporting/init.go b/convey/reporting/init.go index 976e8179..8bc3db35 100644 --- a/convey/reporting/init.go +++ b/convey/reporting/init.go @@ -84,7 +84,8 @@ func monochrome() { } func isColorableTerminal() bool { - return strings.Contains(os.Getenv("TERM"), "color") + term := os.Getenv("TERM") + return strings.Contains(term, "color") || strings.Contains(term, "xterm") } // This interface allows us to pass the *testing.T struct @@ -92,4 +93,4 @@ func isColorableTerminal() bool { // having to import the "testing" package. type T interface { Fail() -} +} \ No newline at end of file From b3342ca072ed16774a5683769839fc977d99b555 Mon Sep 17 00:00:00 2001 From: Karl Matthias Date: Mon, 22 Jul 2024 19:08:37 +0100 Subject: [PATCH 2/2] Fmt --- convey/reporting/init.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/convey/reporting/init.go b/convey/reporting/init.go index 8bc3db35..2a6e4b94 100644 --- a/convey/reporting/init.go +++ b/convey/reporting/init.go @@ -84,7 +84,7 @@ func monochrome() { } func isColorableTerminal() bool { - term := os.Getenv("TERM") + term := os.Getenv("TERM") return strings.Contains(term, "color") || strings.Contains(term, "xterm") } @@ -93,4 +93,4 @@ func isColorableTerminal() bool { // having to import the "testing" package. type T interface { Fail() -} \ No newline at end of file +}