gnodet commented on code in PR #1713:
URL: https://github.com/apache/maven-mvnd/pull/1713#discussion_r3741241746
##########
common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java:
##########
@@ -814,17 +854,159 @@ private void addProjectLine(final List<AttributedString>
lines, Project prj) {
.append('(')
.append(execution.getExecutionId())
.append(')');
- final Message.ProjectTestProgressEvent tp = prj.testProgress;
+ final Message.ProjectTestProgressEvent tp =
aggregateTestProgress(prj.testProgress.values());
if (tp != null) {
appendTestProgress(asb, tp);
}
}
lines.add(asb.toAttributedString());
}
+ /** Matches SGR (color) escape sequences emitted by the daemon-side log
renderer. */
+ private static final Pattern ANSI = Pattern.compile("\\[[0-9;]*m");
Review Comment:
**Bug:** This regex is missing the ESC character (`\u001B`) prefix. Real
ANSI sequences are `ESC[...m`, so the pattern should be:
```suggestion
private static final Pattern ANSI = Pattern.compile("\u001B\\[[0-9;]*m");
```
Without it, `stripDecoration()` leaves orphan ESC characters in the output,
breaking the `BANNED_MARKER` equality check when Maven's color output is
enabled.
The unit test should also be updated to use `"\u001B[1m"` instead of bare
`"[1m"`.
--
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]