From de54470be4854fa18997ab08d894ee6c56c2349b 2013-03-04 22:53:49 From: MinRK Date: 2013-03-04 22:53:49 Subject: [PATCH] Backport PR #2491: color is supported in ironpython changes for ongoing effort to make ipython to work under ironpython I have activated color support. --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index e1de793..c2b7847 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -624,7 +624,7 @@ class InteractiveShell(SingletonConfigurable): # override sys.stdout and sys.stderr themselves, you need to do that # *before* instantiating this class, because io holds onto # references to the underlying streams. - if sys.platform == 'win32' and self.has_readline: + if (sys.platform == 'win32' or sys.platform == 'cli') and self.has_readline: io.stdout = io.stderr = io.IOStream(self.readline._outputfile) else: io.stdout = io.IOStream(sys.stdout) diff --git a/IPython/core/magics/basic.py b/IPython/core/magics/basic.py index 74f073b..9b4fdf9 100644 --- a/IPython/core/magics/basic.py +++ b/IPython/core/magics/basic.py @@ -309,7 +309,8 @@ Currently the magic system has the following functions:""", import IPython.utils.rlineimpl as readline if not shell.colors_force and \ - not readline.have_readline and sys.platform == "win32": + not readline.have_readline and \ + (sys.platform == "win32" or sys.platform == "cli"): msg = """\ Proper color support under MS Windows requires the pyreadline library. You can find it at: diff --git a/IPython/utils/rlineimpl.py b/IPython/utils/rlineimpl.py index c585ea9..b4e894a 100644 --- a/IPython/utils/rlineimpl.py +++ b/IPython/utils/rlineimpl.py @@ -73,7 +73,7 @@ if have_readline and hasattr(_rl, 'rlmain'): line = lineobj.TextLine(line) return _rl.add_history(line) -if sys.platform == 'win32' and have_readline: +if (sys.platform == 'win32' or sys.platform == 'cli') and have_readline: try: _outputfile=_rl.GetOutputFile() except AttributeError: