Queries the terminal for all capability-based input sequences and then adds on a terminal-dependent input sequence mapping.
For reference see:
Terminfo is incomplete. The vim source implies that terminfo is also incorrect. Vty assumes that the internal terminfo table added to the system-provided terminfo table is correct.
The procedure used here is:
Build terminfo table for all caps. Missing caps are not added.
Add tables for visible chars, esc, del, ctrl, and meta.
Add internally-defined table for given terminal type.
Precedence is currently implicit in the compile algorithm.