check if output is decorated before to write ansi escape sequence