2010/1/13 Nathan Adams <adam...@datanethost.net>: > On Wed, Jan 13, 2010 at 8:24 AM, Hannes Magnusson > <hannes.magnus...@gmail.com> wrote: >> On Wed, Jan 13, 2010 at 15:08, Richard Quadling >> <rquadl...@googlemail.com> wrote: >>> 2010/1/13 Kalle Sommer Nielsen <ka...@php.net>: >>>> 2010/1/13 Richard Quadling <rquadl...@googlemail.com>: >>>>> I've no problem with the default for coloured output on Windows be set >>>>> to false. It is just a case of adding -c on to my command line, but >>>>> disabling it completely means I've lost a useful feature of the >>>>> logging system. >>>> >>>> Well feel free to set it to false by default, I just saw this as the >>>> quickest for now, but if you want to re-enable it feel free to >>>> >>>> -- >>>> regrads, >>>> >>>> Kalle Sommer Nielsen >>>> ka...@php.net >>>> >>> >>> I think the issue is that the default should be the same for both >>> windows and non-windows. >>> >>> Personally, if the default is false, then everyone wanting coloured >>> output needs to enable it. >>> >>> Anyone else? >> >> >> If its possible to see if the terminal supports colors then enable it >> by default.. >> >> -Hannes >> > > I think detecting if color is supported is a great idea, and certainly > a middle ground for those who do and don't want coloring to be > default. > > I am not a Linux expert, but from what I can see the shell doesn't > explicitly set an environment variable like "COLOR=YES" (at least not > on Ubuntu Server 9.04 using putty). On Ubuntu Desktop 9.10 it does set > an environment variable "COLORTERM=gnome-terminal" However, the script > could look at the environment variable SHELL and see if it is running > a shell that supports color output. > > I have never used the third party program "ANSICON", does it set an > environment variable? > > My thoughts anyways. >
ANSICON is a windows app and it does set an env_var. The env_var is called ANSICON. The variable is of the form "WxH (wxh)", where W & H are the width and height of the buffer and w & h are the width and height of the window. With the envvar set ... <?php while(true) {echo getenv('ANSICON'), "\r";} ?> will show the var. As you resize the window, the var changes. -- ----- Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling