From owner-freebsd-hackers Thu May 6 23:57:13 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from magnesium.ideal.net.au (magnesium.ideal.net.au [203.20.241.212]) by hub.freebsd.org (Postfix) with ESMTP id B7C48154C3 for ; Thu, 6 May 1999 23:56:53 -0700 (PDT) (envelope-from andrew@ugh.net.au) Received: from localhost (andrew@localhost) by magnesium.ideal.net.au (8.9.1/8.9.1) with SMTP id QAA01525; Fri, 7 May 1999 16:56:45 +1000 (EST) (envelope-from andrew@ugh.net.au) Date: Fri, 7 May 1999 16:56:45 +1000 (EST) From: andrew@ugh.net.au X-Sender: andrew@magnesium.ideal.net.au To: freebsd-hackers@freebsd.org Cc: snadge@gemcorp.com.au Subject: Termcap and cursor keys Message-ID: X-WonK: *wibble* MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 from an xterm on both systems. If I type ctrl-V 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