[code-reflection] RFR: OpWriter.ColoringOption proposal [v3]
Gary Frost
gfrost at openjdk.org
Tue Sep 9 08:42:59 UTC 2025
On Mon, 8 Sep 2025 17:57:03 GMT, Adam Sotona <asotona at openjdk.org> wrote:
>> I propose `OpWriter` enables simple ANSI coloring based on `jdk.incubator.code.extern.OpWriter.COLOR` system property.
>>
>> ANSI coloring sample:
>> <img width="989" height="746" alt="ansi-coloring" src="https://github.com/user-attachments/assets/2025bcbe-6c6c-48ab-8ed5-67ff88b47fe6" />
>
> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>
> removed ColoringOption
> ANSI coloring is triggered by jdk.incubator.code.extern.OpWriter.COLOR property
As I mentioned in slack. My problem here that that , if we have code which generates text from OpWriter buried in a lib call that you are unaware of, and you add this property on the command line (because you want to colorize some output from your call) everyone now needs to defecnd their code against these CSI/ANSI sequences.
Specifically HAT was forced to reparse the output from OpWriter to apply its formmatting/tooling, this code is definately not expecting to see CSI/ANSI escape sequences in the output from OpWriter.
I am in general favor of a solution, but the caller of OpWriter needs direct control of formatting, it should not be based on a global property IMHO.
-------------
PR Comment: https://git.openjdk.org/babylon/pull/546#issuecomment-3269551309
More information about the babylon-dev
mailing list