On Thu, Sep 29, 2016 at 7:12 AM, João Matos <jcrma...@gmail.com> wrote: > What is your Windows version? Are you trying on the cmd.exe console or PS?
Are you talking about PowerShell ISE? That doesn't work for interactive console programs such as Python's REPL shell. Otherwise, FYI, there is no such thing as a cmd.exe or powershell.exe console. Those are shells, which can even run detached from a console using standard handles for the NUL device, pipes, or disk files. A shell that's attached to a console is just another console client application. Here's a brief overview of the Windows console system. Each console window is hosted by an instance of conhost.exe, but you can't simply run conhost.exe and get a console window. It depends on specific command-line arguments and handle inheritance, and Microsoft doesn't publish the implementation details. (It could be reverse engineered but there's not much to be gained from that.) A process can attach to a single console and set its standard input, output, and error file handles to either the console's input buffer or one of its screen buffers (or a new screen buffer via CreateConsoleScreenBuffer). This will be set up automatically by Windows if the executable is flagged as a console program and isn't run as a detached process. Otherwise a program can manually allocate or attach to a console via AllocConsole or AttachConsole. It can detach via FreeConsole. Attaching and detaching needs to be handled with care when updating the C standard FILE streams. Getting it wrong can crash the process. _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/