I have a terminal that is set in ~(ICANON) mode and wondering how I can use the data that I get for the backspace (which is ^?) so I can send a putchar('\b') to the console to go back one space.
EDIT:
struct termios new;
newt.c_lflag &= ~(ICANON);
tcsetattr(STDIN_FILENO, TCSANOW, &newt); // Set the console to send each char straight away.
char c;
while ((c = getchar()) != '\n){
// If the backspace key is pressed, the symbols ^? appear on the screen. How do I
// Interpret the backspace to send back a '\b' char to the screen. I don't want the ^?
// to appear on the screen when the backspace is pressed but rather the cursor move one
// space to the left.
}
Thanks