Subject: Re: Creeping PCism...
To: Johnny Billquist <bqt@update.uu.se>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-users
Date: 02/09/2004 12:43:04
On Mon, 9 Feb 2004, Johnny Billquist wrote:

> On Mon, 9 Feb 2004, Ben Collver wrote:
>
> > On Mon, Feb 09, 2004 at 03:11:47PM +0100, Johnny Billquist wrote:
> > > > > Or, to express that specific problem another way: how do I get a tty to
> > > > > bind erase to ^? when that tty just is created to run a telnet command?
> > > >
> > > > stty erase ^?
> > >
> > > Sorry, but telnet don't have a stty command. Otherwise that would have
> > > solved it in this case, yes.
> >
> > Run the stty command BEFORE you run telnet.
>
> You're not reading what I'm writing. I'm not running the telnet command
> from a shell prompt. In this case, I', creating an xterm, which runs
> telnet. There is no shell, and no way to run stty before.

echo "XTerm*ptyInitialErase: true" | xrdb -merge -

or

echo "*ptyInitialErase: true" | xrdb -merge -

if your telnet starter's xterms have a different class name.

Not that that only turns *off* setting the erase character from the
termcap entry (which you could also change, if you wanted to do it
that way), so if you now open an xterm from an xterm that already has
erase set to ^H, you won't see the desired effect. (The pty then gets
its settings from the parent pty.)

Once you achieve your ambition, you'll find pretty quickly that a lot
of programs, "less" for example, send a BS to the terminal upon
recieving a DEL character, expecting the erase character to be set to
^H, so...

As a practical matter, another thing you need to be aware of is that
the so-called BackSpace key (note embedded cap) will alway give you
either ^H or ^?, depending on whether or not you hold the Control key
down -- what's more, you can always toggle it to the opposite sense by
holding down Control while left-clicking in the xterm, then scrolling
down to the menu option that says "Backarrow Key (BS/DEL)". Note that
this *only* applies to the key which the Xserver knows as "BackSpace".
If you remap your BackSpace key to Delete (with "xmodmap", "xkbcomp"
or by changing the sources of your Xserver), none of that will work.

Frederick