diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 2f6c22e..4d7796a 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -629,7 +629,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 5825640..980a0a6 100644 --- a/IPython/core/magics/basic.py +++ b/IPython/core/magics/basic.py @@ -313,7 +313,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: