tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: wsvt25 backspace key should match terminfo definition



Valery Ushakov <uwe%stderr.spb.ru@localhost> writes:

> On Tue, Nov 23, 2021 at 00:01:40 +0000, RVP wrote:
>
>> On Tue, 23 Nov 2021, Johnny Billquist wrote:
>> 
>> > If something pretends to be a VT220, then the key that deletes
>> > characters to the left should send DEL, not BS...
>> > Just saying...
>> 
>> That's fine with me too. As long as things are consistent. I suggested the
>> kernel change because both terminfo definitions (and the FreeBSD console)
>> go for ^H.
>
> Note that the pckbd_keydesc_us keymap maps the scancode of the <- key to
>
>     KC(14),  KS_Cmd_ResetEmul, KS_Delete,
>
> i.e. 0x7f (^?).
>
> terminfo is obviously incorrect here.  Amazingly, the bug is actually
> in vt220 description!  wsvt25 just inherits from it:
>
> $ infocmp -1 vt220 | grep kbs
>         kbs=^H,
>
> I checkeed termcap.src from netbsd-4 and it's wrong there too.  I have
> no idea htf that could have happened.

I think (memory is getting fuzzy) the problem is that the old terminals
had a delete key, in the upper right, that users use to remove the
previous character, and a BS key, upper left, that was actually a
carriage control character.


The basic problem is that in the PC world, the idea is that key where
DEL should be has a backarrow the the PC world thinks it is backspace.
That's the DEC-centric viewpoint of course :-)

I think any change needs a careful proposal and review, becuase there
are lots of opinions here and a change is likely to mess up a bunch of
people's configs, even if they have worked around something broken.  I
don't mean "no changes", just that if you don't think this is a really
hard problem you probably shouldn't change it (globally).

Also /usr/include/sys/ttydefaults.h is about all of NetBSD on all sorts
of hardware, not just PCs and there are lots of keyboards as well as
actual terminals.   Ever since we moved beyond ASR33, CERASE has been
0177 (my Unix use more or less began with a VT52 and a Beehive CRT).

xterm has a config to say "make the key where DEL ought to be generate
the key that the tty has configured as ERASE".  I suspect that the right
approach is

  1) choose what wscons generates for the "key where DEL belongs"

  2) have the tty set so that the choice in (1) is 'stty erase'.

I see the same kbs=^H on vt52.


I think the first thing to answer is "what is kbs in terminfo supposed
to mean".



My other question is how kbs is used from terminfo.  Is it about
generating output sequences to move the active cursor one left?  If so,
it's right.  Is it about "what should the user type to delete left",
then for a vt52/vt220, that's wrong.  If it is supposed to be both,
that's an architectural bug as those aren't the same thing.

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index