Merge branch 'master' into mcpe-1.2

This commit is contained in:
Dylan K. Taylor
2017-09-18 10:29:38 +01:00
5 changed files with 12 additions and 11 deletions

View File

@ -57,7 +57,13 @@ abstract class Terminal{
if(isset($opts["disable-ansi"])){
self::$formattingCodes = false;
}else{
self::$formattingCodes = ((Utils::getOS() !== "win" and getenv("TERM") != "" and (!function_exists("posix_ttyname") or !defined("STDOUT") or posix_ttyname(STDOUT) !== false)) or isset($opts["enable-ansi"]));
self::$formattingCodes = (isset($opts["enable-ansi"]) or ( //user explicitly told us to enable ANSI
stream_isatty(STDOUT) and //STDOUT isn't being piped
(
getenv('TERM') !== false or //Console says it supports colours
(function_exists('sapi_windows_vt100_support') and sapi_windows_vt100_support(STDOUT)) //we're on windows and have vt100 support
)
));
}
}