Skip to content

Commit

Permalink
Add more terminals with color support (#1621)
Browse files Browse the repository at this point in the history
  • Loading branch information
p00f authored Jul 4, 2023
1 parent 408f9e0 commit 43b2917
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/colorprint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,24 @@ bool IsColorTerminal() {
#else
// On non-Windows platforms, we rely on the TERM variable. This list of
// supported TERM values is copied from Google Test:
// <https://github.com/google/googletest/blob/main/googletest/src/gtest.cc#L2925>.
// <https://github.com/google/googletest/blob/v1.13.0/googletest/src/gtest.cc#L3225-L3259>.
const char* const SUPPORTED_TERM_VALUES[] = {
"xterm", "xterm-color", "xterm-256color",
"screen", "screen-256color", "tmux",
"tmux-256color", "rxvt-unicode", "rxvt-unicode-256color",
"linux", "cygwin",
"xterm",
"xterm-color",
"xterm-256color",
"screen",
"screen-256color",
"tmux",
"tmux-256color",
"rxvt-unicode",
"rxvt-unicode-256color",
"linux",
"cygwin",
"xterm-kitty",
"alacritty",
"foot",
"foot-extra",
"wezterm",
};

const char* const term = getenv("TERM");
Expand Down

0 comments on commit 43b2917

Please sign in to comment.