Handle backspace key in terminal.