Subject: Re: Creeping PCism...
To: Ben Collver <collver1@comcast.net>
From: Greg Troxel <gdt@ir.bbn.com>
List: netbsd-users
Date: 02/09/2004 11:54:27
  From what I read at http://www.columbia.edu/kermit/backspace.html, ^H as
  backspace comes from American National Standard X3.4-1977, Section 5.1,
  Control Characters.  Since NetBSD/i386 pckbd/wscons emulates vt100 by
  default, I see an interesting puzzle.  The vt100 has both a backspace key
  (mapped to 8) and a rubout key (mapped to 127?).  Should the PC backspace
  key be mapped to backspace?  Sounds logical to me.

I realize you probably know all of this, but:

BS (^H, 010) is an output code that moves the carriage one place left.
What those codes do on input is another issue.  Historically (well,
since V7 or so) DEL (0177) has been used to delete the last character
typed as input, even on printing terminals (which used some sort of
encoding to clue in the user, and ^R to redesp/pse/isplay).  The DEL
key was handy, and used to delete backwards.  The BS key was less
handy, and was in my recollection not used much (in the 1978 era of
Seventh Edition).

The IBM PC (or AT :-) keyboards labeled the delete key with Backspace
or an arrow.  From the DEC crowd point of view, this was an egregious
blunder (or in line with the mainframe practice of the time).  For a
long time, unix systems were configured to generate a delete keycode
from this key, and used 0177 as the erase character.  (Either that or
I remapped it, but I think that's a recent issue.)

This is complicated by the expected GUI behavior of things like
mozilla.  The key which is where DEL belongs (backspace on pc
keyboards) is expected to delete left and the 'Delete' key is expected
to delete forward.  These programs get X keycodes/keysyms, so the tty
settings are irrelevant.

This weekend I installed an ultra5 over a serial console with kermit
on i386 running current.  Typing the backspace key resulted in ^H on
the single-user shell.  So our erase-is-^H decision is not universal.
Arguably, remote systems should expect DEL in the pty stream.

There is a further problem, which is that when running emacs on an
xterm on a remote system pressing Meta-BS (which should be Meta-DEL)
results in sending 0210, not 0377, and executes C-M-h (mark-defun)
instead of M-DEL (backward-kill-word).  So perhaps emacs should rebind
that too when erase is ^H, but this really seems like propagating
brokenness.

I would argue that by default

  the key that is where DEL belongs should generate 0177 in xterms
  (and behave like delete in emacs) and generate the keysym in X that
  programs like mozilla expect.

  the other key labeled Delete should generate in X the
  'delete-forward' keysym (and some ansi sequence in xterm - I don't
  really care).

But, I realize that different people have different preferences.  So
it would be really nice to have a global setting (at build time, or
compile) that defined whether the key that is where DEL should be
should generate 0177 or 010, and have all the other decisions flow
from this one setting.

  
  From: Johnny Billquist <bqt@update.uu.se>

  I wander between the PC display and keyboard and normal, plain, actual
  text terminals, which behave the way god intended them to. And nowadays

Amen, Brother Johnny!  Your excellent rant about creeping PCisms made
we want to power up my VT52, and maybe an LSI-11/23!

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