What's a simple way to using backspace in non canonical mode in linux terminal ?
It's part of code, when i set flags:
struct termios old_tio, new_tio;
/* get the terminal settings for stdin */
tcgetattr(STDIN_FILENO, &old_tio);
/* we want to keep the old setting to restore them a the end */
new_tio = old_tio;
/* disable canonical mode (buffered i/o) and local echo */
new_tio.c_lflag &=(~ICANON );/*& ~ECHOE );*/
/* set the new settings immediately */
tcsetattr(STDIN_FILENO,TCSANOW,&new_tio);
for(;1;) {
c = getchar();
switch(c) {...}
}
And when i press backspace i get an
^?
. But i need to erase last symbol..
Thank you.