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

> 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.

But my problem is not that I can't get the xterm to generate a DEL, but
that my telnet client don't recognize DEL as deleting a char when I talk
locally with the client. Since I want the "<-" key to send DEL, it is not
an option to change it to send backspace.

For my remote connection, I really have to use DEL, so I *definitely* want
the key to send DEL.

*ptyInitialErase is a resource for binding what character should be send
when pressing whatever key it figures. I already know what character I
want to send.

You're working on the wrong end of the rope here. :-)

> 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...

I don't really know what you're talking about here.
Upon receipt of whatever character that erase is bound to, all programs
that don't do just about everything themself, sends BS SP BS. What
character you bound erase to don't matter.

> 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.

There is so much more to this than that.
I can get whatever code I want to in X, from any key. It's getting
applications to deal with things the right way that is the problem. And
yes, getting an Xterm to send DEL isn't difficult at all.

	Johnny

Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt@update.uu.se           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol