Do not print colors if the output is redirected. Fixes #4289