mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-30 07:26:51 +08:00
Fix crash on unset environment variable.
This commit is contained in:
parent
606e0efdfe
commit
e34dc1606e
@ -36,7 +36,11 @@ Terminal::Dimensions Terminal::Size() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Terminal::CanSupportTrueColors() {
|
bool Terminal::CanSupportTrueColors() {
|
||||||
std::string COLORTERM = std::getenv("COLORTERM");
|
char *COLORTERM_RAW = std::getenv("COLORTERM");
|
||||||
|
if (nullptr == COLORTERM_RAW) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
std::string COLORTERM = COLORTERM_RAW;
|
||||||
return COLORTERM.compare("24bit") || COLORTERM.compare("trueColor");
|
return COLORTERM.compare("24bit") || COLORTERM.compare("trueColor");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user