gnodet commented on PR #11927: URL: https://github.com/apache/maven/pull/11927#issuecomment-4501303376
_Claude Code on behalf of Guillaume Nodet_ @kwin is right — #11887 is the simpler fix and is already merged. #11887 addresses the root cause: JLine's `TerminalBuilder` was configured with `ForcedSysOut`, which bypasses TTY detection on stdout. Changing it to `SysOut` lets JLine correctly detect piped output and fall back to a dumb terminal, disabling ANSI colors. It's a 3-line change with no reflection or JDK version branching. This PR works around the symptom instead — using reflection to call `Console.isTerminal()` (JDK 22+) in two places, with duplicated helper methods. Since the root cause is already fixed, this can be closed. The one additional thing this PR does is patch the Maven 3 compat path (`MavenCli`), but that code path has never done pipe detection (it only disables color for batch mode or log file), so adding a reflection-based workaround there doesn't seem worth the complexity. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
