| 125 | } |
| 126 | |
| 127 | static bool hasTerminalVT100SupportImpl() |
| 128 | { |
| 129 | // See https://no-color.org/ for reference. |
| 130 | const auto noColorEnvVar = getEnvironmentVariable("NO_COLOR"); |
| 131 | if (!noColorEnvVar.empty()) |
| 132 | { |
| 133 | return false; |
| 134 | } |
| 135 | |
| 136 | const auto termEnvVar = getEnvironmentVariable("TERM"); |
| 137 | if (termEnvVar.empty()) |
| 138 | { |
| 139 | return false; |
| 140 | } |
| 141 | |
| 142 | return termEnvVar.compare("xterm") == 0 |
| 143 | || termEnvVar.compare("xterm-256color") == 0 |
| 144 | || termEnvVar.compare("rxvt-unicode-256color") == 0; |
| 145 | } |
| 146 | |
| 147 | bool hasTerminalVT100Support() |
| 148 | { |
no test coverage detected