Skip to content

Commit

Permalink
Add colored output support for Alacritty
Browse files Browse the repository at this point in the history
  • Loading branch information
memdo committed Mar 15, 2024
1 parent c231e6f commit a1a6083
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions googletest/src/gtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3270,6 +3270,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
term != nullptr && (String::CStringEquals(term, "xterm") ||
String::CStringEquals(term, "xterm-color") ||
String::CStringEquals(term, "xterm-kitty") ||
String::CStringEquals(term, "alacritty") ||
String::CStringEquals(term, "screen") ||
String::CStringEquals(term, "tmux") ||
String::CStringEquals(term, "rxvt-unicode") ||
Expand Down
1 change: 1 addition & 0 deletions googletest/test/googletest-color-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def testNoEnvVarNoFlag(self):
self.assertTrue(UsesColor('xterm', None, None))
self.assertTrue(UsesColor('xterm-color', None, None))
self.assertTrue(UsesColor('xterm-kitty', None, None))
self.assertTrue(UsesColor('alacritty', None, None))
self.assertTrue(UsesColor('xterm-256color', None, None))

def testFlagOnly(self):
Expand Down
3 changes: 3 additions & 0 deletions googletest/test/gtest_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6671,6 +6671,9 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
SetEnv("TERM", "xterm-kitty"); // TERM supports colors.
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.

SetEnv("TERM", "alacritty"); // TERM supports colors.
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.

SetEnv("TERM", "xterm-256color"); // TERM supports colors.
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.

Expand Down

0 comments on commit a1a6083

Please sign in to comment.