-
Notifications
You must be signed in to change notification settings - Fork 175
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
Detecting ANSI compatibility #553
base: master
Are you sure you want to change the base?
Conversation
|
You know, you can call |
No, I don't know that. What is that? |
It's how you get ANSI control codes in cmd and powershell. I don't know why it's not better optimized. Just call that at program start. There are no downsides that I am aware of. |
weird, I didn't see any mention of it while I was looking for a way to enable ANSI in cmd on windows. Also that won't work on <win10? By using |
That is true, it is Win10+. But it will work in all situations/combinations (power shell or cmd) on Win10+, so no need to check |
So, you're ok with making it incompatible with anything lower than win10? What's wrong with the proposed solution, that should cover all edge cases? |
If you want you could also set with the set console properties! I definitely don't want to deliberately leave out Win7 and lower. |
Added check for ANSI escape support. This should resolve possible edge cases.
For windows I am setting console mode to enable ANSI and if it fails, fall back to simple terminal.
https://learn.microsoft.com/en-us/windows/console/getconsolemode
Tested on win11 and win7. Would appreciate if you test it on win10 or 8 also.