#include #include int main() { char *term = getenv("TERM"); if (term) { printf("TERM=%s\n", term); } else { printf("TERM is not set.\n"); return 1; } if (system("tput colors") == 0) { printf("Colors are supported\n"); } else { printf("Colors are NOT supported\n"); } return 0; }