mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +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() {
|
||||
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");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user