In a terminal that does not support ANSI escape code, outputting a color control code like \033[0m will not only have no effect, but will also disturb the terminal.
I know a json formatting tool called jq, which judges whether the terminal can use ANSI escape code.
I want to know, how to realize this function through C programming language?