title: IPython NoConsoleScreenBufferError (Windows)
body: <p>When running any line on the IPython CLI on Windows, most times I am getting a <code>NoConsoleScreenBufferError</code> and the console is terminated.</p>
  
  <p>This happens when running IPython from the Windows terminal (<code>cmd.exe</code> > <code>ipython</code>) or when using the embedded PyCharm terminal (it uses the Windows terminal) which chooses IPython automatically over the regular Python terminal, in installed.</p>
  
  <p>Here is part of the relevant trace:</p>
  
  <pre><code>  File "C:\Python27\lib\site-packages\IPython\__init__.py", line 119, in start_ipython
      return launch_new_instance(argv=argv, **kwargs)
    File "C:\Python27\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance
      app.start()
    File "C:\Python27\lib\site-packages\IPython\terminal\ipapp.py", line 348, in start
      self.shell.mainloop()
    File "C:\Python27\lib\site-packages\IPython\terminal\interactiveshell.py", line 486, in mainloop
      self.interact()
    File "C:\Python27\lib\site-packages\IPython\terminal\interactiveshell.py", line 469, in interact
      code = self.prompt_for_code()
    File "C:\Python27\lib\site-packages\IPython\terminal\interactiveshell.py", line 363, in prompt_for_code
      pre_run=self.pre_prompt, reset_current_buffer=True)
    File "C:\Python27\lib\site-packages\prompt_toolkit\interface.py", line 392, in run
      self._redraw()
    File "C:\Python27\lib\site-packages\prompt_toolkit\interface.py", line 351, in _redraw
      self.renderer.render(self, self.layout, is_done=self.is_done)
    File "C:\Python27\lib\site-packages\prompt_toolkit\renderer.py", line 398, in render
      size = output.get_size()
    File "C:\Python27\lib\site-packages\prompt_toolkit\terminal\win32_output.py", line 103, in get_size
      info = self.get_win32_screen_buffer_info()
    File "C:\Python27\lib\site-packages\prompt_toolkit\terminal\win32_output.py", line 150, in get_win32_screen_buffer_info
      raise NoConsoleScreenBufferError
  NoConsoleScreenBufferError: No Windows console found. Are you running cmd.exe?
  
  If you suspect this is an IPython bug, please report it at:
      https://github.com/ipython/ipython/issues
  or send an email to the mailing list at ipython-dev@scipy.org
  
  You can print a more detailed traceback right now with "%tb", or use "%debug"
  to interactively debug it.
  
  Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
      %config Application.verbose_crash=True
  </code></pre>