Subject: Re: Backspace vs Delete on Console in 1.5.3
To: Christian Hattemer <chris@heaven.riednet.wh.tu-darmstadt.de>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 08/30/2002 13:09:03
On Thu, Aug 29, 2002 at 11:55:31PM +0200, Christian Hattemer wrote:
> On 25-Aug-02 Christian Hattemer wrote:
> 
> > if my memory isn't totally wrong, on the console (ttyE0) the backspace key
> > used to produce ^H while the delete key produced ^?.
> 
> I found my memory was wrong, this behaviour is there since nearly 4 years.
> 
> This was changed in Rev. 1.2 of sys/dev/pckbc/wskbdmap_mfii.c. Half of the
> changes (the KS_KP_Delete vs. KS_Delete part) has already been reverted in
> Rev. 1.20 and 1.15.4.1. I have reverted the other half for myself too and it
> seems to work fine. Now I can have distinct backspace and delete functions
> as on X.

Under X backspace generates ^H, and ctl-backspace ^?.  The delete key
generates the escape sequence \e[3~ (significantly more useful than
^?).

> The only problem I've seen so far is that sh does backspace on ^? and does
> not react on ^H, which is now sent by the backspace key.

I tried to find that bug yesterday, it eluded me :-(
Normally ^? and ^H (and whatever stty erase is set to) get mapped
to either delete the previous character, or to move left.
However inside 'cw' the 'erase' character no longer works, although ^?
will delete the last typed character (if it isn't the erase character).
Clearly something to do with vi_delete_prev_char and ed_delete_prev_char
but it all seemed backwards, and I couldn't see why 'cw' and 'i'
behaved differently.

> However sh is rarely used interactively.

What do people use?
I was using ksh, but recently started using sh (because it should
have all the facilities I actually use [1]) only to find lots of little
annoying (and easily fixable) bugs.

	David

[1] I added 'cd x y' so I can do 'cd src obj' etc...
-- 
David Laight: david@l8s.co.uk