Skip to content

Commit

Permalink
Merge pull request #171 from bnjones/master
Browse files Browse the repository at this point in the history
Don't use colour by default on dumb terminals
  • Loading branch information
sn6uv committed Oct 26, 2013
2 parents 5ac67c5 + 99b9da8 commit 4fd6866
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mathics/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"""

import sys
import os
import argparse
import re
import locale
Expand Down Expand Up @@ -52,7 +53,9 @@ def __init__(self, definitions, colors):
else:
colorama_init()
if colors is None:
colors = 'Linux' if sys.stdout.isatty() else 'NoColor'
terminal_supports_color = (sys.stdout.isatty() and
os.getenv('TERM') != 'dumb')
colors = 'Linux' if terminal_supports_color else 'NoColor'

color_schemes = {
'NOCOLOR': (
Expand Down

0 comments on commit 4fd6866

Please sign in to comment.