Use ncurses function to handle backspace