Fixed --enable-ansi and --disable-ansi not being respected on threads

this causes some breakage to the behaviour of Terminal, and for that reason this is going on 4.0.

Terminal::hasFormattingCodes() will no longer auto-detect whether colour codes are supported.
This commit is contained in:
Dylan K. Taylor
2018-12-29 11:23:32 +00:00
parent 10ac322b8f
commit 498bffb34f
3 changed files with 38 additions and 29 deletions

View File

@ -183,7 +183,7 @@ namespace pocketmine {
define('pocketmine\RESOURCE_PATH', \pocketmine\PATH . 'resources' . DIRECTORY_SEPARATOR);
$opts = getopt("", ["data:", "plugins:", "no-wizard"]);
$opts = getopt("", ["data:", "plugins:", "no-wizard", "enable-ansi", "disable-ansi"]);
define('pocketmine\DATA', isset($opts["data"]) ? $opts["data"] . DIRECTORY_SEPARATOR : realpath(getcwd()) . DIRECTORY_SEPARATOR);
define('pocketmine\PLUGIN_PATH', isset($opts["plugins"]) ? $opts["plugins"] . DIRECTORY_SEPARATOR : realpath(getcwd()) . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR);
@ -195,6 +195,14 @@ namespace pocketmine {
//Logger has a dependency on timezone
Timezone::init();
if(isset($opts["enable-ansi"])){
Terminal::init(true);
}elseif(isset($opts["disable-ansi"])){
Terminal::init(false);
}else{
Terminal::init();
}
$logger = new MainLogger(\pocketmine\DATA . "server.log");
$logger->registerStatic();
\GlobalLogger::set($logger);