sabotage-linux / netbsd-curses

libcurses and dependencies taken from netbsd and brought into a portable shape (at least to musl or glibc)
Other
147 stars 14 forks source link

Add toe utility #32

Open tpimh opened 6 years ago

tpimh commented 6 years ago

toe - table of (terminfo) entries

With no options, toe lists all available terminal types by primary name with descriptions. File arguments specify the directories to be scanned; if no such arguments are given, your default terminfo direc‐ tory is scanned. If you also specify the -h option, a directory header will be issued as each directory is entered.

rofl0r commented 6 years ago

i just wanted to add it, then noticed that this tool is not even in netbsd proper... probably because netbsd curses doesn't use terminfo directories at all (but a single binary database instead).

tpimh commented 6 years ago

Well, if it's not toe, there should be some other utility to print the contents of this binary database.

rofl0r commented 6 years ago
$ infocmp xterm-256color
# Reconstructed from /home/rofl/.terminfo.cdb
xterm-256color|xterm with 256 colors,
        am, bce, ccc, km, mc5i, mir, msgr, npc, xenl,
        colors#256, cols#80, it#8, lines#24, pairs#32767,

is that about what you imagined ?

tpimh commented 6 years ago

Well, not exactly. It always shows only xterm-256color, but I'm sure there should also be at least vt100 and other popular options.

rofl0r commented 6 years ago

so basically you want it to print a list of all built-in supported TERMs, for use with infocmp to query the details ?

tpimh commented 6 years ago

Yes, is it possible with infocmp?

rofl0r commented 6 years ago

it seems the listing aspect is currently not implemented, but it would be trivial to add it (less than 10 lines, i'd guess). i'll forward this to Roy Marples and see what he thinks about it.