On Sat, Jan 03, 2026 at 08:12:15PM -0600, G. Branden Robinson wrote:
> At 2026-01-03T17:50:14-0500, Thomas Dickey wrote:
> > There's two problems with the suggested change.
> [...]
> > Second, having two names for the same key isn't something that I'd
> > recommend, since curses applications will detect the first key in the
> > table.
> 
> Don't we say the opposite in ncurses documentation, at least for key
> names injected via tic/infocomp -x?
> 
> curs_inopts(3NCURSES):
>      Low‐level applications can use tigetstr(3NCURSES) to obtain the
>      definition of any string capability.  curses applications use the
>      input character reading function to obtain key codes from input and
>      rely upon the order in which the string capabilities are loaded.
>      Multiple key capability strings can have the same value, but the
>      input character reading function can report only one key code.
>      Most curses implementations (including ncurses) load key
>      definitions in the order they appear in the strfnames array of
>      string capability names; see terminfo_variables(3NCURSES).  The
>      last capability read using a particular definition determines the
>      key code to be reported.  In ncurses, extended capabilities can be
>      interpreted as key definitions.  The library loads these after its
>      built‐in definitions, and if an extended capability’s value is the
>      same as one previously loaded, the library uses the later
>      definition.

I was misreading the error message (it does say "last", and looking
for examples, the second one in some of the messages is an extended
capability).  But I was commenting on two of the standard capabilities,
which is often going to cause confusion.

> Regards,
> Branden



-- 
Thomas E. Dickey <[email protected]>
https://invisible-island.net

Attachment: signature.asc
Description: PGP signature

Reply via email to