NetBSD-Users archive

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

Re: termcap issue



mlelstv%serpens.de@localhost (Michael van Elst) writes:

> When hitting the backarrow key ("backspace") on the Mac keyboard,
> it apparently sends a DEL character. The terminal on the Mac probably
> also defines the erase character as DEL.

The Mac Terminal.app (10.9) preferences has a "Delete sends Control-H"
checkbox.  I'm not sure if it default to off, but I would guess so.

> The sshd on your NetBSD machine initializes the pseudo tty to use
> the same erase character as the client.

This seems obviously the right thing.

> The tset command in .login sees a valid terminal description and
> initializes the erase character to what the terminal database
> defines. For xterm-256color that is kbs=^H.

This seems to me to be the wrong result, but what's wrong is nonobvious.
I can see two theories:

  when the erase character has been set via sshd, don't mess with it,
  because the remote side set it for a reason.

  changing how the delete key works (DEL vs BS) is too big a thing for
  the same termcap entry, and there should be two entries.

A further issues is that how "xterm" is defined perhaps should vary
across MACHINE_ARCH because of differing norms in the original systems.
On a PC, erase being BS is normal, but on vax (pmax, and probably sparc)
erase is DEL.

It's also funny that it's about tset, which is invoked in the csh
default login script.  It does not seem to be invoked in the default sh
script (on netbsd-6).

So I wonder if tset should have a "don't mess with erase" option to be
put in the .login call.

Do you think what's happening now (that remote users with erase=DEL end
up with erase=BS when sshing into NetBSD 7 using the default csh
scripts) is the right behavior, overall?

> There is more to it. Like what the keyboard driver maps the
> backarrow key to (DEL on pckbd, BS on ukbd) or what keyboard
> mapping a particular terminal emulator (xterm, KDE, putty, ...)
> uses and how programs in raw or cbreak mode interpret tty input.

Agreed this is pretty complicated...

Attachment: pgpeI8oNXhw1E.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index