Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 500 - emerge output should not be coloured when redirected
Summary: emerge output should not be coloured when redirected
Status: RESOLVED DUPLICATE of bug 414
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Geert Bevin
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-02 13:00 UTC by Arcady Genkin
Modified: 2005-07-17 13:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arcady Genkin 2002-02-02 13:00:49 UTC
It would be nice if emerge would not output color escape sequences when 
redirected to a pipe or a file.  Assuming that Python allows to check the type 
of the file descriptor, of course.

It's unnerving to see the "junk" when piping the output to `less', for 
example. ;^)
Comment 1 Chad Huneycutt (RETIRED) gentoo-dev 2002-02-02 18:45:29 UTC
I think 'less -r' (which should be the default in newer baselayouts) will do
what you want.  For other cases, if there is not already, we should probably
provide an option to emerge that disables color (like keychain).
Comment 2 Arcady Genkin 2002-02-02 22:56:29 UTC
"less -r" does what you say, but my main point was that whenever the output goes
to anything other than a terminal, the color escapes are, probably, not
welcome.  So, if there is a way to detect what sort of a file descriptor the
stdout is, the output should not be coloured unless it is a tty.
Comment 3 Geert Bevin 2002-02-03 16:24:17 UTC
Imho it's not possible to detect this automatically, therefor marking as
duplicate of bug 414

*** This bug has been marked as a duplicate of 414 ***