Added a null check to TERM_PROGRAM environment variable check.

This commit is contained in:
Casey Langen 2016-07-03 02:36:30 -07:00
parent 9ee2d4442b
commit 1d1c3a18bd

View File

@ -77,7 +77,11 @@ static bool customColorsSupported() {
#ifdef WIN32
return true;
#else
std::string term = std::string(std::getenv("TERM_PROGRAM"));
const char* termEnv = std::getenv("TERM_PROGRAM");
std::string term;
if (termEnv && strlen(termEnv)) {
term = std::string(termEnv);
}
return term != "Apple_Terminal";
#endif
}