#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <string.h>

int main()
{
    struct termios ts1, ts2;

    if (!isatty(0)) {
        fprintf(stderr, "Not a terminal, sorry\n");
        return 1;
    }

    tcgetattr(0, &ts1);
    memcpy(&ts2, &ts1, sizeof(ts1));

    ts1.c_cc[VINTR] = 0;
    tcsetattr(0, TCSANOW, &ts1);

    while (1)
        sleep(1);

    tcsetattr(0, TCSANOW, &ts2);
    return 0;
}
