Hello, I did some investigation and it seems the problem with "\a" is not that the output is not colored but that it's printed at all while it should not be. It's being printed even when re_search in EGexecute doesn't return a match. As a result the for loop in print_line_middle is not being run - this means the "a" output that you see is not from the matched string but from the rest of the line. To fix this I suggest to return NULL from print_line_middle if `b` variable equals NULL - which means the loop was not executed.
I'm sending the patch with the fix in the attachment. Best regards, Tomasz Dziendzielski
0001-grep-Don-t-print-line-if-matcher-returned-nothing.patch
Description: Binary data