enable ability to highlight text only if does not already contain colors
I am using extensively matching patterns for coloring lines of text in the terminal in order to make them easier to read.
In most cases the patterns do look like:
(?i)^((\+\+? |#|\* |info|task|notice|remote|hint|debug?).*)$ which is a pattern that identify INFO log levels and makes them dark grey. Similar for other log levels like errors or warnings.
Now there is one single flaw with this: if you happen to use a tool that is already using ANSI in its output you will lose its original colors because you override it with your own colors.
So, I am looking for a way to tell iTerm to either:
- apply these patterns only when line does not already have coloring on it (ANSI default could be a good enough test)
- allow coloring overrides only for characters that are not already colored.