diff --git a/site_scons/gem5_scons/__init__.py b/site_scons/gem5_scons/__init__.py index 169e0fe064..33231127cf 100644 --- a/site_scons/gem5_scons/__init__.py +++ b/site_scons/gem5_scons/__init__.py @@ -41,6 +41,7 @@ from __future__ import print_function import os +import sys import textwrap from gem5_scons.util import get_termcap @@ -131,6 +132,10 @@ class Transform(object): # The width warning and error messages should be wrapped at. text_width = None +# If stdout is not attached to a terminal, default to 80 columns. +if not sys.stdout.isatty(): + text_width = 80 + # This should work in python 3.3 and above. if text_width is None: try: