bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: curses vs. xterm key mismatch


From: Thomas Dickey
Subject: Re: curses vs. xterm key mismatch
Date: Fri, 13 Apr 2007 20:25:19 -0400 (EDT)

On Fri, 13 Apr 2007, Will Parsons wrote:

I'm working on a curses application that is supposed to react to an End
key, but this does not seem to be recognized in a xterm under FreeBSD 6.1.
Investigation shows that when I press either of the End keys, what curses
sees is 0601, which seems to be defined as KEY_SELECT in curses.h.  (There
is no problem running under a real console.)  Is this an xterm issue, a
terminfo issue on FreeBSD, or something else, and what is the best/proper

It's a limitation of the way any version of curses works.

They use the first keycode in their table which is assigned to a given string. Since xterm is emulating a vt100/vt220, that means it's thinking
of KEY_SELECT rather than the PC-style Home/End.  You can switch the
terminal description and get a different behavior.

A quick check shows I'm using the PC-style in xterm's terminfo.
Ditto for ncurses.  FreeBSD has its own termcap (though I recall
its xterm entries being modified to match ncurses a couple of years
ago).  But it could be either flavor - or both.  At one point both
definitions were in the terminal description, but since curses uses
only one, I removed the one that was less useful.  If your terminal
description has both, curses will use the first one in the table,
(looks like KEY_HOME would override...)

way of handling this?  (Obviously, I can have my program simply look for
KEY_SELECT in addition to KEY_END, but this doesn't seem right to me.)

The value of TERM is xterm.

- Will



_______________________________________________
Bug-ncurses mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-ncurses


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]