[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Vi backspace key problem



Quoting John Haxby <jch scalix com>:

Tim Edwards wrote:

Whenever I press backspace while editing a file in vi it inserts the ^? character instead. Does anyone know the magic way to stop this happening, its getting really annoying having to use delete every time I make a little mistake in vi. This doesn't happen on our RHEL3 boxes.

What does "stty -all" say what the erase character is? Mine says it's "^?" (aka DEL, \127) and that's what konsole and gnome-terminal map the backspace key on to. xterm, on the other hand, maps it on to ^H (aka BS, \010). I'd guess that someone "helpful" has done a "stty erase ^H" for you so that the backspace key works in xterm.

Yup, this is usually due to somebody being too helpful, knowing too little, or both. The erase character will usually be set to correct value (based on termcap, terminfo, or serial line settings), and if you are using ssh to connect to remote machine, this setting will be transfered too.

Tim might want to check his shell's initialization files, both personal and
system wide and check to see if there's any "stty" lines that change erase
character to something other-then-default.

If he's using bash (default shell in RHEL), check:

/etc/profile
/etc/bashrc
/etc/profile.d/*.sh
~/.profile
~/.bash_profile
~/.bashrc

Using stty command in any of those initialization files is more likely to make
trouble, than solve problems. Red Hat 7.3 used to override erase character in
/etc/bashrc, and I remember (back in those days) that I had to manually remove
stty line from it on each and every box that I administered to get my terminal
sessions working correctly. Luckily, folks from Red Hat realized changing
erase character from /etc/bashrc was bad idea, and dropped it sometime between
Red Hat 7.3 and today. If Tim's box is an upgrade from an older Red Hat
distribution (such as 7.3), then it might have this old buggy version of
/etc/bashrc (in which case, either remove entire if block that starts with line
"if [ -x /usr/bin/tput ]; then" near the end of file, or copy /etc/bashrc from a
freshly installed Fedora or RHEL4 machine, RHEL3 /etc/bashrc might work also,
don't have any RHEL3 boxes nearby to check it out).


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]