Slackware's Dobbs Tux with Pipe logo - not created by me
Dave's Slackware Package Blog


Installs a minimal set of terminal database entries
Created: 2018-07-14


This (partial) terminfo database is the last of the three aaa_* prefixed packages in the Slackware a series.

Ancient cruft

The terminfo database is used to describe the capabilities of your early 1980s serial display terminal you’re reading this on right now! Yeah, or far more likely, the terminal emulator you use within X Windows.

Programs use the database to look up the proper escape sequence to display different colors, move the cursor, blank the screen, or use any other terminal capability.

You can see the installed database entries by heading over to /usr/share/terminfo:

$ cd /usr/share/terminfo
$ ls
1  3  5  7  9  E  M  P  X  b  d  f  h  j  l  n  p  r  t  v  x
2  4  6  8  A  L  N  Q  a  c  e  g  i  k  m  o  q  s  u  w  z
$ ls 1
1178  1730-lm
$ ls 3
386at  3b1

As you can see, the entries are organized into directories by the first character of the entry name.

However, the full database you see above is not installed by the the aaa_terminfo package! The whole thing actually comes from the ncurses package later (making this package ultimately redundant in the same fashion as aaa_elflibs).

The SlackBuild script contains this snippet:

# This has been the tradition starter collection since forever.
for dir in l n u v x ; do
  mkdir -p usr/share/terminfo/$dir
  ( cd usr/share/terminfo/$dir
	cp -a /usr/share/terminfo/$dir/* .

I like that comment explaining the rationale for the selection of the l, n, u, v, and x directories.

I’m betting l is there to contain the linux console/terminal type, which is built into the Linux kernel and is the one you interact with before you start X Windows.

The x directory contains 88 entries starting with xterm*, which are often used by terminal emulators under X Windows (including, of course, the venerable xterm itself!).

The v directory contains the entries for the extremely popular DEC VT series of terminals upon which many emulators are based. You can still buy working terminals.

There are just a handful of terminals in the u directory (and some symlinks for alternative names): uniterm, unknown, uts30, and uwin. Perhaps unknown is the reason for this directory’s inclusion?

I have no idea which of the entries in n make it special.

Not much to see or do

This package exists to make an extremely minimal system install possible. There are no libraries or utilities which come with it.

About the only thing we can do with this package is take a look at some of the entries in the database.

The terminfo entries are in a binary format (compiled with tic from a textual source), so we need to view them with a utility such as infocmp:

$ infocmp linux
#	Reconstructed via infocmp from file: /usr/share/terminfo/l/linux
linux|linux console,
	am, bce, ccc, eo, mir, msgr, xenl, xon,
	colors#8, it#8, ncv#18, pairs#64,
	bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l\E[?1c,

That goes on for a while and looks like a crazed badger got onto your keyboard. Good old escape sequences…​

You can see which terminfo database entry you’re currently using by displaying the $TERM variable. Here’s mine:

$ echo $TERM

Oh, and as the name suggests, we can use infocmp to compare terminfo entries:

$ infocmp $TERM linux
comparing xterm-256color to linux.
	comparing booleans.
		eo: F:T.
		km: T:F.
		mc5i: T:F.
		npc: T:F.
		xon: F:T.
	comparing numbers.
		colors: 256, 8.
		cols: 80, NULL.
		lines: 24, NULL.
		ncv: NULL, 18.
		pairs: 32767, 64.


But the whole point of terminfo is to never have to directly deal with these properties anyway.

So let’s pretend we never even saw any of that.

I’m certain we’ll really start to have fun when we get to the ncurses package!