mirror of
https://github.com/google/googletest.git
synced 2025-01-17 13:38:09 +08:00
urxvt supports colors
This commit is contained in:
parent
f8c44a0ae4
commit
1197daf357
@ -2886,6 +2886,8 @@ bool ShouldUseColor(bool stdout_is_tty) {
|
|||||||
String::CStringEquals(term, "xterm-256color") ||
|
String::CStringEquals(term, "xterm-256color") ||
|
||||||
String::CStringEquals(term, "screen") ||
|
String::CStringEquals(term, "screen") ||
|
||||||
String::CStringEquals(term, "screen-256color") ||
|
String::CStringEquals(term, "screen-256color") ||
|
||||||
|
String::CStringEquals(term, "rxvt-unicode") ||
|
||||||
|
String::CStringEquals(term, "rxvt-unicode-256color") ||
|
||||||
String::CStringEquals(term, "linux") ||
|
String::CStringEquals(term, "linux") ||
|
||||||
String::CStringEquals(term, "cygwin");
|
String::CStringEquals(term, "cygwin");
|
||||||
return stdout_is_tty && term_supports_color;
|
return stdout_is_tty && term_supports_color;
|
||||||
|
@ -6672,6 +6672,12 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
|
|||||||
SetEnv("TERM", "screen-256color"); // TERM supports colors.
|
SetEnv("TERM", "screen-256color"); // TERM supports colors.
|
||||||
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
|
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.
|
SetEnv("TERM", "linux"); // TERM supports colors.
|
||||||
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
|
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user