mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-11-08 07:48:11 +08:00
Fix crash on unset environment variable.
This commit is contained in:
committed by
Arthur Sonzogni
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user