Re: delete key printing ^H

Matt McClure (matthew.mcclure@yale.edu)
Tue, 30 Mar 1999 15:41:55 -0500

> As for dealing with it, there's pretty exhaustive information in
> the "Delete and Backspace" section of the keyboard and console howto.
> http://metalab.unc.edu/LDP/HOWTO/Keyboard-and-Console-HOWTO.html

I had checked that out already, but it didn't answer all my questions. What
I'm really wondering is how bash, for example, can handle both ^H and ^?,
echoing neither to stdout, but using both to delete the last character typed
(or do whatever you set it to do using the builtin bind)? Using stty can
make it so that one of the two doesn't get echoed to stdout, but is there a
way to make it so that neither gets echoed, and both erase a character... or
better yet, so that, in all command-line programs, backspace deletes the
last character typed and delete erases the character in front of the cursor?

I guess a separate question is how to write programs so that they echo
neither ^H nor ^?. How does bash avoid it when perl, run from within that
shell, echoes one or the other?

-Matt