Some programs have a colored output (such as
emerge on my gentoo system), but if their output is piped, into
less for example or into a file, the colored output is disabled.
Yet, I know
less is able to display colored output, as commands such as
ccze -A < /var/log/emerge.log | less
do display colored text. So I have two questions here :
Is it possible to "trick" other colored output programs to keep the coloration ?
I would like to keep colors if I do for example :
emerge -puND world | less
How do these programs detect that their output is redirected ?