Q:

Can I keep the formatting of the compiler output when handling it?

Whenever I call run GCC, it nicely formats its output (making filenames bold, note labels white, error labels red, etc.). However, when I want to redirect it and still keep it displayed, the formatting just disappears...
Example:
make                                    # The display is formatted
(...)
make |& tee >(xargs echo > example.out) # The display is not formatted
(...)

How can I redirect the output while keeping the original display formatted?

A:

The documentation says (File: gcc-6.info,  Node: Diagnostic Message Formatting Options):

-fdiagnostics-color[=WHEN]
Use color in diagnostics.  WHEN is never, always, or auto.
  The default depends on how the compiler has been configured, it can
  be any of the above WHEN options or also never if GCC_COLORS
  environment variable isn't present in the environment, and auto
  otherwise.  auto means to use color only when the standard error
  is a terminal.

