Subject: Re: xterm & termcap
To: None <collver@linuxfreemail.com>
From: Julian Coleman <jdc@coris.demon.co.uk>
List: netbsd-help
Date: 12/07/2001 12:51:52
> I am running NetBSD 1.5.2 and XF336.
> termcap has "ku" aka "kcuu1" mapped to "\EOA"
> xterm actually emits "\E[A"
> 
> On an HPUX 10.20 system I see xterm "kcuu1" mapped to "\E[A"
> On a Solaris 5.8 system I see xterm "kl" mapped to "\EOA"
> 
> which is correct?
> 
> Even though xterm emits something other than termcap specifies,
> my up arrow key works in vi.  I'm not familiar enough with the
> internals of vi to know why my cursor keys actually work.  Does
> anyone else know why?

The keypad and cursor keys have two modes - 'normal' and 'application'.  If
you hold down <control> and press the middle mouse button when in your xterm
window, you can see that application mode is normally off.  To enable it,
programs can use the keypad() curses function.  This uses the termcap entries
'ks' and 'ke' to turn application mode on and off, respectively.  Look what
the keypad and cursor keys generate after :

	printf "\e[?1h"
	printf "\e="

J

-- 
                    My other computer also runs NetBSD
                          http://www.netbsd.org/