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

[3.x] Enable ANSI escape code processing on Windows 10 and later #66216

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Sep 21, 2022

3.x version of #44118.

This lets the engine and projects use the same color codes in the terminal on all platforms.

I tested this on Windows 10 (where it works) and on Windows 7 (where ANSI escape codes are printed as-is). Since Windows versions older than 10 are now EOL, this is probably acceptable, but feel free to improve on this in a future PR (e.g. by stripping ANSI escape codes).

Note that this PR does not include print_rich(), as it's difficult to backport. You can still print colored text to the terminal using the following approach:

var escape = PoolByteArray([0x1b]).get_string_from_ascii()
var code = "[1;32m"
print(escape + code + "Bold green text")

This lets the engine and projects use the same color codes
in the terminal on all platforms.
@Calinou Calinou requested a review from a team as a code owner September 21, 2022 15:22
@Calinou Calinou added this to the 3.6 milestone Sep 21, 2022
@Calinou Calinou changed the title Enable ANSI escape code processing on Windows 10 and later Enable ANSI escape code processing on Windows 10 and later (3.x) Sep 21, 2022
@aaronfranke
Copy link
Member

Since Windows versions older than 10 are now EOL,

Windows 8.1 support, and Windows 7 extended support, don't end until 2023. That said, Godot doesn't have to drop them at the same time as Microsoft (whether we do it earlier or later).

@bruvzg
Copy link
Member

bruvzg commented Sep 22, 2022

Windows 8.1 support, and Windows 7 extended support, don't end until 2023.

It's extended support for 8.1 and extended security updates (paid service for enterprise and embedded editions) for 7. Mainstream support ended a long time ago.

@akien-mga akien-mga merged commit 8a6763c into godotengine:3.x Sep 22, 2022
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the windows-enable-ansi-escape-codes-3.x branch September 22, 2022 14:22
@akien-mga akien-mga changed the title Enable ANSI escape code processing on Windows 10 and later (3.x) [3.x] Enable ANSI escape code processing on Windows 10 and later Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants