diff --git a/src/pocketmine/utils/Terminal.php b/src/pocketmine/utils/Terminal.php index c47257886..0afda817e 100644 --- a/src/pocketmine/utils/Terminal.php +++ b/src/pocketmine/utils/Terminal.php @@ -57,13 +57,15 @@ abstract class Terminal{ if(isset($opts["disable-ansi"])){ self::$formattingCodes = false; }else{ + $stdout = fopen("php://stdout", "w"); self::$formattingCodes = (isset($opts["enable-ansi"]) or ( //user explicitly told us to enable ANSI - stream_isatty(STDOUT) and //STDOUT isn't being piped + 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 + (function_exists('sapi_windows_vt100_support') and sapi_windows_vt100_support($stdout)) //we're on windows and have vt100 support ) )); + fclose($stdout); } }