Skip to content

Change the ansi support detection to return true for Windows 10+#49571

Open
plumstone wants to merge 2 commits intospring-projects:mainfrom
plumstone:implement-windows-ansi-support-detection
Open

Change the ansi support detection to return true for Windows 10+#49571
plumstone wants to merge 2 commits intospring-projects:mainfrom
plumstone:implement-windows-ansi-support-detection

Conversation

@plumstone
Copy link
Copy Markdown

Enhancement proposal

Windows supports console ANSI output since build 10586 (End of 2015). Therefore I thought it would make sense to update the ANSI support detection in Spring Boot.

The only slight issue I noticed is that the JDK does not return the build number for Windows systems which in result cannot be checked. https://github.com/openjdk/jdk/blob/master/src/java.base/windows/native/libjava/java_props_md.c#L502

So with this change only the earliest versions of Windows 10 until 2016 (which are no longer supported anyway) would give out a wrong result whether they support ANSI.

Now I need your feedback. Is this acceptable? Should I add more test cases?

Thanks in advance. :)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 11, 2026
@plumstone plumstone force-pushed the implement-windows-ansi-support-detection branch from 56d6be5 to 4e6a7d3 Compare March 11, 2026 22:12
@philwebb
Copy link
Copy Markdown
Member

We've had a similar request in the past and found ANSI support in Windows quite hard to get working consistently. See #34835 (comment) for some previous analysis.

If we do consider this again, I think it should be for Windows 11+ only.

@wilkinsona
Copy link
Copy Markdown
Member

@plumstone would you like to update your proposed changes so that they're Windows 11+ only?

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Mar 16, 2026
@snicoll
Copy link
Copy Markdown
Member

snicoll commented Mar 26, 2026

@plumstone how is it going? No rush but wondering if that's still on your radar as we're approaching RC1.

Signed-off-by: Philemon Hilscher <philemon847@gmail.com>
@plumstone plumstone force-pushed the implement-windows-ansi-support-detection branch from 4e6a7d3 to 41585ec Compare March 27, 2026 23:16
@plumstone
Copy link
Copy Markdown
Author

plumstone commented Mar 27, 2026

Implementation is done. I just tested the changes in a built bootJar. Works fine :)

image

Signed-off-by: Philemon Hilscher <philemon847@gmail.com>
@plumstone plumstone force-pushed the implement-windows-ansi-support-detection branch from 41585ec to 3b1349d Compare March 27, 2026 23:18
@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants