Grep has 3 color modes: Auto, Always, and Off.
Auto deletes codes when connected to a non-interactive output, for example, to a channel (if you want to understand why, try redirecting the output of grep --color=always to a file, and then look at the file .. control codes everywhere)
source share