Bug 251724 - The termcap database /etc/termcap is not compliant to the documentation
Summary: The termcap database /etc/termcap is not compliant to the documentation
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2020-12-10 11:11 UTC by schily
Modified: 2020-12-10 11:11 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description schily 2020-12-10 11:11:07 UTC
I recently checked the FreeBSD termcap database with the termcap compiler termcap(1) from the schilytools.

To check, call e.g.:

    termcap if=/etc/termcap > /tmp/compiled

This reads all entries from /etc/termcap, checks them and then produces a
unified new output in /tmp/compiled. Unified means here that the output
uses the same escape notation format for all control characters and that the
entries for all terminals are in the same official order.

It turned out that the database is full of entries that are not specified in the documentation and thus have no official meaning.

This produces warning like:

NOTICE(ibm3151). Unknown entry ('U8'): 'U8=\E<A'

Here, it may be that the user string "u8" was meant.

Another problem is that there are entries that do not follow the basic syntax, e.g. because they are using more than two characters for the key name:

BAD(8675). Illegal entry (3rd char '0' for 'k10'): 'k10=\Ed'

BTW: The official name for the function key k10 is 'k;'

There are bad cursor movement definitions, e.g.:

BAD(delta). Bad format '%' in 'cm=^O%^F8%+9%^F8%+9'
BAD(annarbor). Bad format '%6' in 'cm=^O%r%6%.%>^S\f%+@'

and there are spaces, where tabs are expected:

BAD(wy120). Skipping blank entry: '        '

Finally, there are a lot of type mismatches, such as:

BAD(trs16). Type mismatch 'UC' in 'UC=\E[_\040q' is STRING should be BOOL
BAD(2392). Type mismatch 'MT' in 'MT' is BOOL should be STRING

Since /etc/termcap changed it's content since FreeBSD-11.2, it seems that
FreeBSD still maintains that file and it would be nice, if it did follow
the official definitions.