Subject: Re: Using the delete key to "right-delete" chars
To: None <port-i386@netbsd.org>
From: Geoff Wing <mason@primenet.com.au>
List: port-i386
Date: 10/01/2003 07:52:37
Ads <ads@hitechplanet.com> typed:
: One feature that I like on some X apps (xdm, mozilla...), is the way they
: use the "Delete" key (above the directional pad) : it deletes the char that
: is on the right of the cursor position.

Terminals have a block cursor which sits on the character not between
characters so delete erases the character *under* the cursor, not to the
right of the cursor.

: But I can't reproduce it on my NetBSD 1.6.1 system, and using the "Delete"
: key just produces a '~' char on a term.

Bet you it produces the four character sequence:  ESC [ 3 ~
This is common with vt220 like terminals.  Your shell will gobble up
the first three characters trying to find something meaningful in them (and
failing) and just give you the tilde

: I searched a way, that would work on both xterms and ascii terms, but was
: unable to find, in that most of the time people use their "Delete" key as a
: "Back Space" key ("left-deleting").

Generally, except for shells which usually provide settable keybindings, if
pressing delete doesn't work then either the application doesn't support
delete or your TERM setting is incorrect.

Zsh: put the next line into your $HOME/.zshrc (or global file)
bindkey '\e[3~' delete-char

Bash: put the next line into your $HOME/.inputrc (or global file)
"\e[3~": delete-char

If you're using a different shell then you need to tell us which shell
you're using.

Regards,
-- 
Geoff Wing : <gcw@pobox.com>
Rxvt Stuff : <gcw@rxvt.org>
Zsh Stuff  : <gcw@zsh.org>