Image

Imagediscordian wrote in Imagelinux 😡annoyed

Backspace problems

I have a stupid problem here. I did something to my machine and I can't figure out what the hell is causing this problem. Whenever I'm in aterm and in vi or have a '>' prompt, such as in FTP, backspace send ^? to the screen. Ctrl+backspace actually sends the backspace. In normal CLI, backspace works just fine. Now... here're a couple of interesting complications. The same behavior doesn't carry over to xterm. Also, if I telnet or SSH to the box using aterm, the problem appears. The problem also effects all users on the box. I looked everywhere I could think of looking. Seems that wasn't enough. I dug through a whole slew of X config stuff. Any software that I installed on one box, but not it's near clone that doesn't have this problem. Nothing. Any ideas?

**EDIT**

This block of code in /etc/bashrc was responsible. I think it followed me from my RH9 upgrade, and foobared things in FC2. I commented it out and the problem went away.

# are we an interactive shell?
if [ "$PS1" ]; then
  if [ -x /usr/bin/tput ]; then
    if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
      stty erase `tput kbs`
    elif [ -x /usr/bin/wc ]; then
     if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb" terminal
      stty erase `tput kbs`0
     fi
  fi
fi


Oddly enough, all of that was setting the stty erase to be ^H. After I took that out, stty -all returns no entry for erase, and everything works perfectly.