Reputation: 3831
Is there a way to find out if a php script is executed in a terminal that supports color control characters?
I would like to be able to execute the same script from my mac terminal or from the sublime text console without passing a flag for color support, and I would like the color control characters to be printed when run in the terminal window, but now when run from the sublime text console.
I assume this is possible, since programs like googletest have colorful output when run directly from the terminal, but don't print color control characters when executed from inside a php script.
Upvotes: 0
Views: 182