NetBSD-Users archive

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

Re: termcap issue



> john%ziaspace.com@localhost (John Klos) writes:
>
>>Sometime between RC1 and RC2, something happened to termcap. I often ssh 
>>from a Mac (TERM is xterm-256color) and nothing has changed on that end 
>>for ages. However, now on any NetBSD-7.0_RC2 system, the shell shows "^?" 
>>whenever a backspace is entered and the terminal is not interactive. Also, 
>>in insert mode in vi, one has to use control-h, as now backspace enters 
>>"^?". What changed? It'd be nice if this were fixed.
>
> 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 sshd on your NetBSD machine initializes the pseudo tty to use
> the same erase character as the client.

That's what I thought as well, and what makes sense.

> 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.
>
> That behaviour changed when termcap was replaced with terminfo.
> The tset command then was modified to almost always ignore the
> kbs setting, which obviously broke local ttys and the console.
>
> The old behaviour has now been mostly restored, so that tset works
> again as documented and also identical to FreeBSD.
>
> Mostly because the old code (from 4.4Lite) would never change
> a ^? erase character except when passed on the tset command line.
> This was fixed in FreeBSD in 1995.

When this was fixed^Wchanged in FreeBSD is rather immaterial for
us, what matters is when this change was done in^W^Wfoisted on
NetBSD.

If I understand correctly, this has the effect that if you log in
via ssh from a machine where the client tty is set to erase=DEL,
the tty on the remote host will first be set to erase=DEL by
sshd, and then when tset is run from .login, it will, based on
local terminfo on that host set erase=^H if your TERM variable
and the local terminfo entry so dictates?

For those among us who rather fiercly wish to stick to the idea
that the "rubout" key commonly found in the upper right area of
the keyboard sends DEL, and who has many more machines than
actively used desktops for logging in to those machines, this is
going to be a major pain.  For the record, I use

XTerm*backarrowKey:     true
XTerm*backarrowKeyIsErase:      true
XTerm*deleteIsDEL:      true
XTerm*ttyModes: erase ^?

in my X resource settings.  However, this is now also blissfully
ignored and overridden by tset based on local terminfo settings
when I start an xterm in "login" mode (-ls) on remote systems via
ssh (which is what I commonly do).  Again: what a pain!

What do you suggest those of us in my situation should do?  That
we should collectively with extreme predjudice comment out tset
from our .login files on all our systems when upgrading to
anything 7.0ish or newer, and ignore the problem this would cause
when using the console or an actual local terminal?

The old behaviour, if I understood correctly, where tset doesn't
muck with the tty key settings if you log in over the network,
and rather leave it to ssh, xterm or telnetd etc. to either carry
the settings from the client or use the settings from the X11
resources makes a lot more sense to me than what we now have in
7.0_RC3.

Regards,

- Håvard


Home | Main Index | Thread Index | Old Index