Subject: Re: Creeping PCism...
To: Johnny Billquist <bqt@update.uu.se>
From: Greg Troxel <gdt@ir.bbn.com>
List: netbsd-users
Date: 02/10/2004 09:44:34
At the risk of beating a dead horse, I must say that while I thought I
understand this all pretty well, I found the xterm man pages to be
hard to follow.  I wrote the following in my .Xresources to clarify
things for myself, and I hope others find it helpful.

I now understand why I was losing with the Ultra5 install.  I had not
set backarrowKey to false, so the i-want-it-to-be-DEL key generated BS
and the single-user shell on the Ultra5 had erase set to DEL (as it
should).

I think it is a bug that:

   ptyInitialErase is not set to true by default,
   and
   backarrowKeyIsErase is not set to true by default,

because of not only the DEL-is-the-traditional-erase-character reason,
but because non-PC systems (RSX-11/M, NetBSD on a serial line, etc.)
expect DEL as the erase character.

I realize this is a matter of opinion, so I won't bother filing a PR.

IMHO NetBSD should pay attention to heritage and tradition, and the
current behavior violates the POLA for those of us who grew up with
real terminals.  I'd like to see the defaults changed as I suggested
above.

Thanks to Johnny for complaining and Frederick and others for
explaining how things work.  This has been annoying me ever since XF86
4 (when it seems to have started), but I had never dug in and really
understood the details before.

    Greg

----------------------------------------

/*
 * The following comments are for those that believe the key that is
 * where the delete (DEL) key belongs (from a VT52 or VT100) should
 * send DEL (0177) and that the terminal erase character should also
 * be DEL (0177).
 * 
 * On a PC keyboard, the BackSpace key generates
 * keycode 22 (keysym 0xff08, BackSpace).
 * The "Delete" key is a function key near Insert, not a DEL key, and it
 * generates keycode 107 (keysym 0xffff, Delete).
 * XXX Figure out what happens under X with a keyboard with a real DEL key.
 */

/*
 * Don't mess with the pty's notion of erase (which defaults to DEL in
 * NetBSD).  This should be set on all computers, regardless of the
 * type of keyboard.
 */
*ptyInitialErase: true

/*
 * Make the backarrow key send DEL (without control), rather than BS.
 * This should be set for any display whose keyboard has a key labeled
 * BackSpace where the delete (DEL) key should be.
 */
*backarrowKey: false

/*
 * Alternatively, one could set backarrowKeyIsErase to true, which the
 * man page says would set the backarrowKey state according to whether
 * stty erase character is DEL or BS.
 */

/*
 * It appears that ssh propagates the local stty erase character
 * setting to the rmote machine, at least when both ends are NetBSD
 * 1.6.2ish.  Thus, fixing the key that should be delete locally
 * (above) is sufficient to cause the correct behavior on remote
 * systems (i.e., ssh sends 0177 when the key-where-DEL-should-be is
 * pressed, the remote stty erase setting is 0177, in emacs both
 * DEL and M-DEL work correctly, and one can invoke help by sending 010
 * (by typing C-DEL or C-H).  (With the standard behavior of DEL
 * sending BS and stty erase set to BS, one cannot easily invoke help
 * in emacs.)
 */

-- 
        Greg Troxel <gdt@ir.bbn.com>