【问题标题】:Running behat through a PHP CLI script escapes out colour codes通过 PHP CLI 脚本运行 behat 会转义颜色代码
【发布时间】:2015-11-09 02:09:32
【问题描述】:
当我直接从 Windows PowerShell 运行 Behat 测试时,输出是用颜色格式化的:
但是当我使用命令php runbehat.php运行下面的php脚本runbehat.php时:
<?php
echo system(__DIR__.'/bin/behat --profile local');
它产生:
如何让它以彩色显示?
【问题讨论】:
标签:
php
powershell
behat
ansi-colors
ansicon
【解决方案1】:
添加--colors 选项。
根据您可以使用-h 显示的行为帮助:
--colors Force ANSI color in the output. By default color support is
guessed based on your platform and the output if not specified.