From 1197daf3571161590dce2bc4879512ef7bc1ba67 Mon Sep 17 00:00:00 2001 From: kosak Date: Tue, 28 Apr 2015 22:04:35 +0000 Subject: [PATCH] urxvt supports colors --- src/gtest.cc | 2 ++ test/gtest_unittest.cc | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/gtest.cc b/src/gtest.cc index bcbbf53a..8b767074 100644 --- a/src/gtest.cc +++ b/src/gtest.cc @@ -2886,6 +2886,8 @@ bool ShouldUseColor(bool stdout_is_tty) { String::CStringEquals(term, "xterm-256color") || String::CStringEquals(term, "screen") || String::CStringEquals(term, "screen-256color") || + String::CStringEquals(term, "rxvt-unicode") || + String::CStringEquals(term, "rxvt-unicode-256color") || String::CStringEquals(term, "linux") || String::CStringEquals(term, "cygwin"); return stdout_is_tty && term_supports_color; diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc index 42638ce2..5509a6b2 100644 --- a/test/gtest_unittest.cc +++ b/test/gtest_unittest.cc @@ -6672,6 +6672,12 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) { SetEnv("TERM", "screen-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. + + SetEnv("TERM", "rxvt-unicode-256color"); // TERM supports colors. + EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY. + SetEnv("TERM", "linux"); // TERM supports colors. EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.