BS/DEL with xterm local & remote

Richard Smith richard at jezebel.demon.co.uk
Wed Aug 18 09:41:18 BST 1999


Mark Ovens wrote:
> 
> On Tue, Aug 17, 1999 at 03:05:12PM +0100, Richard Smith wrote:
> > Mark Ovens wrote:
> > >
> > > On Mon, Aug 16, 1999 at 03:33:36PM +0100, Richard Smith wrote:
> > > > I have a weird problem with xterm. I have a number of _identical_
> > > > FreeBSD boxes (running 3.2R) which I talk to using xterm. Key mappings
> > > > for DEL and BS for zsh and emacs are pretty much sorted out by their own
> > > > configuration files. I notice a difference between the DEL and BS
> > > > mapping between a remote xterm and a local xterm when running simple
> > > > commands expecting command line input.
> > > >
> > > > For example, run 'cat' and you can type some characters. A local xterm
> > > > maps BS to a backward-delete-char while DEL echos ^?. A remote xterm
> > > > maps DEL to a backward-delete-char while BS echos ^H.
> > > >
> > >
> > > Sounds like the local user has ``stty erase ^H'' somewhere (.login,
> > > .{csh,sh}rc etc.)
> >
> > Well...
> >
> > I don't use any of those files, but I _did_ do some rooting around.
> > stty(1) reports that the erase is setup differently on the two xterms,
> > as you surmised.
> >
> 
> I just grepped for ``stty'' in ~/.* and .profile contains:
> 
> #       $Id: dot.profile,v 1.10.2.2 1997/09/27 15:35:46 joerg Exp $
> #
> PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
> echo 'erase ^H, kill ^U, intr ^C'
> stty crt erase ^H kill ^U intr ^C
> [snip..]
> 
> I haven't added this. Mind you, I have to have ``stty erase ^H''
> in my .cshrc to use BS as the backward-delete-char, so I'm not
> exactly sure as to when ~/.profile is read.

I've solved it :)

'stty erase ^H' is effectively hardcoded into syscons (see
/sys/dev/syscons/syscons.c:696). And getty(8) avoids changing it. So as
you log in locally, 'stty erase ^H' is already set for you, without
having to put it into a profile (it's working even _before_ login).
Remote connections use the default defined in sys/ttydefaults.h

Cheers,
Richard.





More information about the Ukfreebsd mailing list