davsclaus commented on code in PR #30016:
URL: https://github.com/apache/camel/pull/30016#discussion_r4578942266
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelCommand.java:
##########
@@ -352,7 +360,24 @@ protected void printlnColored(Object text) {
* (CAMEL-26911).
*/
protected boolean colorsStripped() {
- return printsToConsole() && AnsiConsole.out().getMode() ==
AnsiMode.Strip;
+ return printsToConsole() && (stripsColorsItself() ||
AnsiConsole.out().getMode() == AnsiMode.Strip);
+ }
+
+ /**
+ * Whether the command leaves out the colors itself, instead of the
console: when the output is not a terminal, as
+ * the console would leave them out then too, and finding that out builds
a JLine terminal, which costs more than
+ * most commands take to print (CAMEL-26937). Unless the console is told
how to print the colors
+ * ({@code -Djansi.mode}).
+ */
Review Comment:
Done in dc0989fd95b2: the Javadoc is split into shorter sentences.
_Claude Code on behalf of davsclaus_
--
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]