Skip to content

Commit

Permalink
Support kitty TERM
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Hananein <i@zloylos.me>
  • Loading branch information
Denis Hananein committed Nov 10, 2022
1 parent e07617d commit 4b7f945
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 @@ -3257,6 +3257,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
const bool term_supports_color = term != nullptr && (
String::CStringEquals(term, "xterm") ||
String::CStringEquals(term, "xterm-color") ||
String::CStringEquals(term, "xterm-kitty") ||
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 @@ -78,6 +78,7 @@ def testNoEnvVarNoFlag(self):
self.assert_(UsesColor('cygwin', None, None))
self.assert_(UsesColor('xterm', None, None))
self.assert_(UsesColor('xterm-color', None, None))
self.assert_(UsesColor('xterm-kitty', None, None))
self.assert_(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 @@ -6636,6 +6636,9 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
SetEnv("TERM", "xterm-color"); // TERM supports colors.
EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.

SetEnv("TERM", "xterm-kitty"); // 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 4b7f945

Please sign in to comment.