Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows 10(ver 1607) cmd.exe ansi color text not work. #46

Open
sunose opened this Issue Aug 4, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@sunose
Copy link

sunose commented Aug 4, 2016

windows 10 (v1607) with python 3.5.1 and python 3.5.2 ,pyreadline ansi color text output in cmd.exe(windws 10.0.14393]),not work,ansi escape code control string just output trash charactor.
pyreadline

@RDCH106

This comment has been minimized.

Copy link

RDCH106 commented Oct 5, 2016

Try this Fix:

RDCH106/SimplePythonTools@ca6def5

You can apply the Fix in the main file of your program where you call the library or the straightforward way is fixing library in the following file:

https://github.com/pyreadline/pyreadline/blob/master/pyreadline/console/ansi.py

The problem is caused because after the Windows Anniversary update, CMD of Windows does not support ANSI color by default and it must be activated using ctypes to enable ENABLE_VIRTUAL_TERMINAL_PROCESSING flag.

Here's the Gist with the necessary code:

https://gist.github.com/RDCH106/6562cc7136b30a5c59628501d87906f7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.