Detect Mintty for color support on Windows
Mintty is now the default terminal in GitBash, and it supports ANSI colors without the need of ANSICON (it even supports 256 colors rather than the 16 colors supported by ANSICON).
This commit is contained in:
parent
8df5d94158
commit
12743d1035
@ -89,7 +89,7 @@ class StreamOutput extends Output
|
|||||||
*
|
*
|
||||||
* Colorization is disabled if not supported by the stream:
|
* Colorization is disabled if not supported by the stream:
|
||||||
*
|
*
|
||||||
* - Windows without Ansicon and ConEmu
|
* - Windows without Ansicon, ConEmu or Mintty
|
||||||
* - non tty consoles
|
* - non tty consoles
|
||||||
*
|
*
|
||||||
* @return bool true if the stream supports colorization, false otherwise
|
* @return bool true if the stream supports colorization, false otherwise
|
||||||
@ -98,7 +98,7 @@ class StreamOutput extends Output
|
|||||||
{
|
{
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
if (DIRECTORY_SEPARATOR === '\\') {
|
if (DIRECTORY_SEPARATOR === '\\') {
|
||||||
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
|
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
|
||||||
}
|
}
|
||||||
|
|
||||||
return function_exists('posix_isatty') && @posix_isatty($this->stream);
|
return function_exists('posix_isatty') && @posix_isatty($this->stream);
|
||||||
|
Reference in New Issue
Block a user