aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBilly Donahue <BillyDonahue@users.noreply.github.com>2016-01-31 16:55:53 -0500
committerBilly Donahue <BillyDonahue@users.noreply.github.com>2016-01-31 16:55:53 -0500
commita9b73f8139a92315f37e48a3ff3d43e3929055bc (patch)
treec519739f2505fe64d0f803c4b023399b59f83e58
parent82b11b8cfcca464c2ac74b623d04e74452e74f32 (diff)
parent340c6b337518d8d78c25b84375ca992351d994aa (diff)
downloadgoogletest-a9b73f8139a92315f37e48a3ff3d43e3929055bc.tar.gz
googletest-a9b73f8139a92315f37e48a3ff3d43e3929055bc.tar.bz2
googletest-a9b73f8139a92315f37e48a3ff3d43e3929055bc.zip
Merge pull request #699 from achimnol/master
Add tmux and tmux-256color to the colored terminal list.
-rw-r--r--googletest/src/gtest.cc2
-rw-r--r--googletest/test/gtest_unittest.cc6
2 files changed, 8 insertions, 0 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 4170e5c7..2bac245d 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -2930,6 +2930,8 @@ bool ShouldUseColor(bool stdout_is_tty) {
String::CStringEquals(term, "xterm-256color") ||
String::CStringEquals(term, "screen") ||
String::CStringEquals(term, "screen-256color") ||
+ String::CStringEquals(term, "tmux") ||
+ String::CStringEquals(term, "tmux-256color") ||
String::CStringEquals(term, "rxvt-unicode") ||
String::CStringEquals(term, "rxvt-unicode-256color") ||
String::CStringEquals(term, "linux") ||
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index 60aed357..355252fc 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -6840,6 +6840,12 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
SetEnv("TERM", "screen-256color"); // TERM supports colors.
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
+ SetEnv("TERM", "tmux"); // TERM supports colors.
+ EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
+
+ SetEnv("TERM", "tmux-256color"); // TERM supports colors.
+ EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
+
SetEnv("TERM", "rxvt-unicode"); // TERM supports colors.
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.