[Python-ideas] VT100 style escape codes in Windows

Joseph Hackman josephhackman at gmail.com
Wed Dec 28 18:00:06 EST 2016


Hey All!

I propose that Windows CPython flip the bit for VT100 support (colors and
whatnot) for the stdout/stderr streams at startup time.

I believe this behavior is worthwhile because ANSI escape codes are
standard across most of Python's install base, and the alternative for
Windows (using ctypes/win32 to alter the colors) is non-intuitive and well
beyond the scope of most users.

Under Linux/Mac, the terminal always supports what it can, and it's up to
the application to verify escape codes are supported. Under Windows,
applications (Python) must specifically request that escape codes be
enabled. The flag lasts for the duration of the application, and must be
flipped on every launch. It seems many of the built-in windows commands now
operate in this mode.

This change would not impede tools that use the win32 APIs for the console
(such as colorama), and is supported in windows 2000 and up.

The only good alternatives I can see is adding colorized/special output as
a proper python feature that actually checks using the terminal information
in *nix and win32.

For more info, please see the issue: http://bugs.python.org/issue29059

Cheers,
Joseph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161228/4e3b112d/attachment.html>


More information about the Python-ideas mailing list