MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / hasTerminalVT100SupportImpl

Function hasTerminalVT100SupportImpl

src/Platform/src/Platform.Posix.cpp:127–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

hasTerminalVT100SupportFunction · 0.70

Calls 2

getEnvironmentVariableFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected