aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8>2011-02-11 16:17:19 +0000
committerpcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8>2011-02-11 16:17:19 +0000
commit9f99325f381f27c4a6218b980d0f037c2bf641bc (patch)
treed0448a0468fcd8a4272f2d34eaf1c62f212aeb2a
parentfb909552a11f82a3f0e578e14724259f89f02e45 (diff)
downloadsos-9f99325f381f27c4a6218b980d0f037c2bf641bc.tar.gz
[core] textcolor(): do not colorize if not outputting to a tty
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@1083 ef72aa8b-4018-0410-8976-d6e080ef94d8
-rwxr-xr-xsos/sosreport.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index be29f4d7..5b3155bd 100755
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -209,7 +209,7 @@ def parse_options(opts):
def textcolor(text, color, raw=0):
""" Terminal text coloring function """
- if GlobalVars.__cmdLineOpts__.nocolors:
+ if GlobalVars.__cmdLineOpts__.nocolors or not os.isatty(1):
return text
colors = { "black":"30", "red":"31", "green":"32", "brown":"33", "blue":"34",
"purple":"35", "cyan":"36", "lgray":"37", "gray":"1;30", "lred":"1;31",