summary refs log tree commit diff
path: root/progs/testterm/testterm.c
blob: 5a7963341f3000f10990fd213ae54ccc2d357593 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <stdlib.h>

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;
}