Skip to content

Commit a9b73f8

Browse files
committed
Merge pull request google#699 from achimnol/master
Add tmux and tmux-256color to the colored terminal list.
2 parents 82b11b8 + 340c6b3 commit a9b73f8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

googletest/src/gtest.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,6 +2930,8 @@ bool ShouldUseColor(bool stdout_is_tty) {
29302930
String::CStringEquals(term, "xterm-256color") ||
29312931
String::CStringEquals(term, "screen") ||
29322932
String::CStringEquals(term, "screen-256color") ||
2933+
String::CStringEquals(term, "tmux") ||
2934+
String::CStringEquals(term, "tmux-256color") ||
29332935
String::CStringEquals(term, "rxvt-unicode") ||
29342936
String::CStringEquals(term, "rxvt-unicode-256color") ||
29352937
String::CStringEquals(term, "linux") ||

googletest/test/gtest_unittest.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6840,6 +6840,12 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
68406840
SetEnv("TERM", "screen-256color"); // TERM supports colors.
68416841
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
68426842

6843+
SetEnv("TERM", "tmux"); // TERM supports colors.
6844+
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6845+
6846+
SetEnv("TERM", "tmux-256color"); // TERM supports colors.
6847+
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
6848+
68436849
SetEnv("TERM", "rxvt-unicode"); // TERM supports colors.
68446850
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
68456851

0 commit comments

Comments
 (0)