In Unix, the default setting for certain keys are different by each platform. For example, erase in Ubuntu might be erase = ^?
. But then, for AIX, it might be totally different like example erase = ^H
. How do I check the stty setting in C?
This is what I have tried to write
#include<stdio.h>
#include<stdlib.h>
#include<termios.h>
#include<unistd.h>
int main()
{
struct termios term;
if(tcgetattr(STDIN_FILENO, &term) < 0)
{
printf("Error to get terminal attr\n");
}
printf("The value for Erase is %s\n",term.c_cc[ERASE]);
return 0;
}
After compiling it using gcc. It says that ERASE undeclared. So what is actually the correct option or variable that I should use?