diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index 6c1d8c5..7c15eb2 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -372,8 +372,9 @@ class TerminalInteractiveShell(InteractiveShell): self._pt_app.layout = create_prompt_layout(**self._layout_options()) def prompt_for_code(self): - document = self.pt_cli.run( - pre_run=self.pre_prompt, reset_current_buffer=True) + with self.pt_cli.patch_stdout_context(raw=True): + document = self.pt_cli.run( + pre_run=self.pre_prompt, reset_current_buffer=True) return document.text def enable_win_unicode_console(self): diff --git a/setup.py b/setup.py index 2ec6cbc..ceb97d2 100755 --- a/setup.py +++ b/setup.py @@ -190,7 +190,7 @@ install_requires = [ 'pickleshare', 'simplegeneric>0.8', 'traitlets>=4.2', - 'prompt_toolkit>=1.0.4,<2.0.0', + 'prompt_toolkit>=1.0.15,<2.0.0', 'pygments', ]