[PATCH 7/8] Do not print color escape codes if stdout is not a tty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
---
 configshell/console.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configshell/console.py b/configshell/console.py
index 985d789..b8dd2e5 100644
--- a/configshell/console.py
+++ b/configshell/console.py
@@ -230,7 +230,7 @@ class Console(object):
         output, reset to default color. Only if not open_end.
         @type todefault: bool
         '''
-        if self.prefs['color_mode']:
+        if self.prefs['color_mode'] and self._stdout.isatty():
             if fgcolor is None:
                 if self.prefs['color_default']:
                     fgcolor = self.prefs['color_default']
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux