Kaixo!

On Tue, Jan 18, 2000 at 03:09:47PM -0600, [EMAIL PROTECTED] wrote:

> I am using Mandrake AIR and had been using 6.1 with no problems before. My
> problem is that while editing code in vim I cannot use backspace as it is
> interpreted as ^?

That is the default on Linux; I don't like it either, I prefer my BS sending
a proper ^H, so I added some support for it.
If you prefer to have BackSpace send a ^H edit the /etc/sysconfig/keyboard
file and add:

BACKSPACE=BackSpace

if you prefer it sending ^? put

BACKSPACE=Delete

instead.

Note that in order to have correct support for it you would need
to copy the attached file to /etc/profile.d/configure_keyboard.sh
it hasn't been included in console-tools as it makes problems in some
cases; try it.

Note also that some xterms are very idiotic when it comes to the 
BackSpace/Delete thing, and invert them whithout giving you the possibility
to tell them not to do.
Also, several text mode programs have their own configurations to be done
in order for the mto properly work.

(If only Linus Torvalds would have set the BackSpace to send ^H from the
beginning !)


-- 
Ki �a vos v�ye b�n,
Pablo Saratxaga

http://www.ping.be/~pin19314/           PGP Key available, key ID: 0x8F0E4975
#!/bin/bash

if [ -x /etc/sysconfig/keyboard ]; then
  . /etc/sysconfig/keyboard 2> /dev/null
fi

if [ -z "$BACKSPACE" ]; then
        # the code for Backspace key is arch-dependent.
        # FIXME: what really returns uname for non-PC machines ???
        case `uname -m`-`uname -p` in
                i[3456789]86-*) BSNUM=14 ;;
                *-amiga) BSNUM=65 ;;
                m68k-atari) BSNUM=14 ;;
                *-macintosh) BSNUM=51 ;;
                mips-sun) BSNUM=43 ;;
                *) BSNUM=999 ;;
        esac
        if [ "$BSNUM" != "999" ]; then
           BACKSPACE=`dumpkeys | grep "^keycode  $BSNUM" | awk '{print $4}'`
        fi
fi

# BackSpace sends BackSpace
if [ "$BACKSPACE" = "BackSpace" ]; then

  # command line
  if tty --quiet ; then
    stty erase '^H'
  fi

  # xterm
  if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" ]; then
     echo -en '\033[36h'
  fi

# BackSpace sends Delete
else

  # command line
  if tty --quiet ; then
    stty erase '^?'
  fi

  # xterm
  if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" ]; then
     echo -en '\033[36l'
  fi
fi

# activate keypad on xterm
if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" ]; then
   # activate keypad
   echo -en '\033>'
fi

Reply via email to