Only use ansi formatting if stdout is a terminal