Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 May 1999 16:56:45 +1000 (EST)
From:      andrew@ugh.net.au
To:        freebsd-hackers@freebsd.org
Cc:        snadge@gemcorp.com.au
Subject:   Termcap and cursor keys
Message-ID:  <Pine.BSF.4.02A.9905071552410.1164-100000@magnesium.ideal.net.au>

next in thread | raw e-mail | index | archive | help
Hi,

I'm having trouble with identifying the press of cursor keys. To use the
up arrow key as an example...

Under FreeBSD 3.0-19990206-STABLE the the termcap library says a vt220
terminal sends ESC O A, as does an xterm. SunOS 5.6 says vt220 sends ESC [
A and xterm sends ESC O A. Linux (Debian) agrees with SunOS.

I determined this by quering for the ku capability.

The xterm that ships with SunOS 5.6 actually sends ESC [ A as does xterm
that comes with Debian Linux...I cant try the FreeBSd one from here but I
would assume it will be the same as Linux.

I determined this by typing ctrl-V <up-arrow> from an xterm on both
systems.

If I type ctrl-V <up-arrow> within vi under SunOS gives ESC O A (from an
xterm) and the same thing under Linux gives the same (despite getting
different thins in the shell (tried tcsh, bash and /bin/sh).

Jason Fesler has told me the correct thing for vt220 to send is ESC [ A
but I cant find the standard anywhere.

Now I'm just very confused...what causes the keys to show up differently
in the shell as oppsoed to vi? I'm assuming curses...which termcap is
correct?...

My main problem is that in my program (under an xterm on SunOS and kvt on
FreeBSD at least) that termcap tells me the up arrow key sends something
different to what it actually does and I'm not sure where the problem
is...I can provide code if anyone is interested.

Thanks,

Andrew




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.02A.9905071552410.1164-100000>