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

Support recent Windows 10 #4

Closed
ferrouswheel opened this issue Feb 15, 2017 · 2 comments
Closed

Support recent Windows 10 #4

ferrouswheel opened this issue Feb 15, 2017 · 2 comments

Comments

@ferrouswheel
Copy link

A recent upgrade to the Windows 10 console resulted in VT mode being disabled by default for child processes. This breaks the ansi escape codes being converted into color.

This answer on StackOverflow fixes it:
http://stackoverflow.com/a/36760881/272238

Here is an explanation of the change that was introduced: microsoft/WSL#1173 (comment)

And here are Python devs refusing to do anything about it in the python interpreter:
https://bugs.python.org/issue29059

So for this module it'd be great to add:

import ctypes

kernel32 = ctypes.windll.kernel32
kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)

when the platform is on windows.

@jonathaneunice
Copy link

Microsoft's turn-off of ANSI coloring is definitely a bummer for colored text.

It's still an open question whether it's the responsibility of an ANSI-text generation library to try to fix it. I understand why it'd be convenient, and why it's annoying ANSI isn't enabled automatically. But twiddling Win32 control bits? That's a very specific and invasive side-effect—one that seems outside ansicolor's remit. Related: It's a side-effect that'd be hard-to-impossible for us to reliably test.

@ferrouswheel
Copy link
Author

Fair enough and I agree - hopefully having this issue documented will help people find a solution more easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants