gnodet-bot commented on code in PR #30016:
URL: https://github.com/apache/camel/pull/30016#discussion_r4578517165


##########
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:
   💬 **Doc nit (low):** 46-word sentence; split for readability.
   
   ```suggestion
       /**
        * Whether the command strips colors itself, instead of the console. 
When the output has no terminal, the console
        * would strip them too, but finding that out builds a JLine terminal — 
which costs more than most commands take
        * to print (CAMEL-26937). Skipped when the console mode is set 
explicitly ({@code -Djansi.mode}).
        */
   ```



-- 
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]

Reply via email to