From ec6e67fd3b0abe8da6fe5e21f2f166bc7a1478a4 2008-08-14 07:09:13 From: Gael Varoquaux Date: 2008-08-14 07:09:13 Subject: [PATCH] Make it more probably to get colors in shell commands. --- diff --git a/IPython/frontend/_process/pipedprocess.py b/IPython/frontend/_process/pipedprocess.py index 0d83995..2cda128 100644 --- a/IPython/frontend/_process/pipedprocess.py +++ b/IPython/frontend/_process/pipedprocess.py @@ -18,6 +18,7 @@ __docformat__ = "restructuredtext en" from killableprocess import Popen, PIPE from threading import Thread from time import sleep +import os class PipedProcess(Thread): """ Class that encapsulates process execution by using callbacks for @@ -47,7 +48,10 @@ class PipedProcess(Thread): def run(self): """ Start the process and hook up the callbacks. """ + env = os.environ + env['TERM'] = 'xterm' process = Popen((self.command_string + ' 2>&1', ), shell=True, + env=env, universal_newlines=True, stdout=PIPE, stdin=PIPE, ) self.process = process