The scenario: Using Cygwin on the client workstation, connecting via ssh to the RHEL box, and running bash and sqlplus on the linux box.
Bash works great on the local workstation and the remote RHEL box. However, sqlplus did not. When I typed a backspace key, the prior character was erased from the buffer, but a control character was echoed to the screen. It looked like a little house, but was actually ^? in stty-speak.
stty -a | grep erase shows that erase is mapped to ^?, which is the backspace key, and all should be good. Like I said, bash works! Vi works... Only sqlplus did not.
The solution is not trying stty erase ^H, like so many posts said. I think that is a remnant of times gone by now, or at least I hope so.
The reason that bash and vim (VI) behave differently from sqlplus is simple - they both do their own processing of input. bash uses readline, and is controlled by /etc/inputrc. sqlplus uses something else, I presume getty, although I don't know for sure, and really don't care.
If you look at the output of stty -a, look for some flags at the bottom of the output saying something like:
iexten echo -echoe -echok -echonl
To fix the borked sqlplus behavior, all I had to do was change the setting for echoe, like this:
~ $ stty echoe
Now when I type stty -a, near the end you will see:
iexten echo echoe -echok -echonl
echoe does the same thing as crterase, which the man page for stty says does this:
"echo erase characters as backspace-space-backspace"
Basically, when the backspace occurs, wipe the character off the screen in addition to removing it from the buffer. Problem solved! sqlplus works fine when I ssh to the RHEL box, and all is good.
Of course, to make sure it works the NEXT time you login, you have to do something like add it to your .bashrc or .bash_profile. I chose to do this on my cygwin box, and put stty echoe into my .bashrc. All works, and I am on to the real problems I am supposed to be solving. :)