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...)
I'm still unsure of what I should be doing - complaining to FreeBSD that
something is wrong with their termcap/terminfo, making some sort of
adjustment in my environment, or simply accepting that KEY_SELECT may do
the same as KEY_END and allowing for that in my application?
Perhaps both.
At the moment I'm looking at the FreeBSD termcap, which appears to be
using for "xterm" the entries that I had updated for XFree86 in 2001.
That was imported into FreeBSD in 2002/08/27.
That particular file is hand-maintained, though I generate a termcap.src
from ncurses' terminfo.src periodically. Checking now, I see that xterm's
termcap file still uses Select as well as End (does not cancel one in
favor of the other, but just adds them both). But the intent of that file
is not to support curses applications, just low-level termcap applications
(though that's what FreeBSD used it for ;-).
For terminfo, I canceled the conflicting keys from the descriptions
a while back (and those are PC-style, with a comment in the terminfo
file indicating how to change the entries to vt220-style).
So - using the termcap entry for curses means you'll get one set of
keycodes, but using the terminfo entry means you'll get a different set.