This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, joseph.hackman, methane, paul.moore, steve.dower, tim.golden, zach.ware
Date 2016-12-29.01:11:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1482973861.27.0.418142888006.issue29059@psf.upfronthosting.co.za>
In-reply-to
Content
> As there is no good interface in core Python to the kernel32 console
> operations (and there probably shouldn't be, it would be better to be 
> consistent), I suggest just flipping the bit at startup on Windows.

I don't follow your statement about consistency. Python could adopt a built-in wincon module to partially support the console API, just like winreg partially supports the registry API. 

When _WindowsConsoleIO was being developed, I mentioned the idea of enabling VT mode a couple of times, but there was no interest that I could see. I don't think Windows devs really care much about this feature, especially since it's only available in Windows 10. colorama has been the popular way to get cross-platform support for supporting text color in terminals and the Windows console. There's also pyreadline, which supports VT escapes and much more. Enabling the console's VT mode won't simplify the implementation of colorama or pyreadline so long as Windows 7 and 8 are supported, which will be for several more years. 

One problem with enabling VT mode at startup is that it could cause compatibility problems with child processes. cmd faced this problem and has since resolved it [1] by reverting to the original console mode before executing a program. If Python enables VT mode at startup, there should be a sys variable (based on a C global) that has the original mode value. Applications would be able to restore the original mode to either opt out entirely or before executing a child process. Py_FinalizeEx would also have to be modified to restore the original mode before shutting down the interpreter.

[1]: http://preview.tinyurl.com/jgtcgfs
History
Date User Action Args
2016-12-29 01:11:01eryksunsetrecipients: + eryksun, paul.moore, tim.golden, methane, zach.ware, steve.dower, joseph.hackman
2016-12-29 01:11:01eryksunsetmessageid: <1482973861.27.0.418142888006.issue29059@psf.upfronthosting.co.za>
2016-12-29 01:11:01eryksunlinkissue29059 messages
2016-12-29 01:11:00eryksuncreate