Home / Alt manpages / toe(1)

  • toe(1)
  • User command
  • linux

Find and Compare Installed Terminfo Entries with toe

toe answers a question that only comes up once something looks wrong: which terminal descriptions does this system have? This guide lists available entries, shows which terminfo directories get searched, and inspects relationships in a source file for database maintenance.

Uses the ncurses implementation installed with Ubuntu's ncurses-bin package, version 6.4+20240113-1ubuntu2.2; /usr/bin/toe -V reports ncurses 6.4.20240113. Allow about ten minutes. You need a shell and a readable terminfo database. These are all read-only queries, and sudo is only relevant if your chosen directory or source file is not readable by your account.

1. Confirm which toe you are running

Check the executable and its ncurses version before comparing output with another machine:

$ command -v toe
/home/linuxbrew/.linuxbrew/bin/toe
$ /usr/bin/toe -V
ncurses 6.4.20240113

That first path is environment-specific: on this machine the interactive shell's PATH picks up a Homebrew ncurses 6.6 build, while the Ubuntu package owns /usr/bin/toe. Use an explicit path when you need reproducible package behaviour, which is why the rest of this guide uses /usr/bin/toe.

Checkpoint

command -v toe prints nothing? The package is missing or its directory is not on PATH. Installing a package is a system change, so use your normal package-management process rather than adding an unreviewed binary to a script.

2. List the available terminal types

Run toe with no directory argument to scan the default terminfo location ncurses picked:

$ /usr/bin/toe | head
9term      Plan9 terminal emulator for X
Eterm      Eterm with xterm-style color support (X Window System)
Eterm-256color      xterm 256-colour terminal emulator
...

Each line is a primary terminal name followed by its description, in whatever order the database and search path give you. This writes to standard output, so redirecting it to a file for later review is safe:

$ /usr/bin/toe > terminfo-list.txt
$ wc -l terminfo-list.txt

That creates or truncates terminfo-list.txt, so pick a new filename if the existing report matters. To avoid collecting every entry while you search, filter the output without touching the database:

$ /usr/bin/toe -s | grep -E '^(linux|screen|xterm|vt100)[[:space:]]'
linux      Linux console
screen     VT 100/ANSI X3.64 virtual terminal
vt100      DEC VT100 (w/advanced video)
xterm      xterm terminal emulator (X Window System)

3. Sort names and show the search directories

Use -s when the entry name matters more than scan order, and -h when you need to know where the command actually looked:

$ /usr/bin/toe -h /usr/share/terminfo | head -n 4
#
#/usr/share/terminfo:
#
9term      Plan9 terminal emulator for X

Passing a directory makes the example deterministic: it asks toe to scan that directory instead of trusting the process environment. Note that a directory here must contain compiled terminfo entries; that is not the same as a terminfo source file.

For a sorted report from one directory, combine the options:

$ /usr/bin/toe -s /usr/share/terminfo | grep -E '^(linux|screen|xterm|vt100)[[:space:]]'
linux      Linux console
screen     VT 100/ANSI X3.64 virtual terminal
vt100      DEC VT100 (w/advanced video)
xterm      xterm terminal emulator (X Window System)

Checkpoint

Entry shows up in one command but not another? Compare directory and environment first. ncurses can use TERMINFO and TERMINFO_DIRS, and toe -a asks for entries from every database directory the terminfo library would search.

4. Compare duplicates across the database search path

Combine -a with -s to include all searched databases and add the database marker column:

$ /usr/bin/toe -as | head -n 12
--> /etc/terminfo
----> /usr/share/terminfo
--*-:  9term      Plan9 terminal emulator for X
--*-:  Eterm      Eterm with xterm-style color support (X Window System)
--*-:  Eterm-256color      xterm 256-colors

The heading lines show directories as they are accessed. In the entry column, * means the same named entries differ between locations, + means they are equivalent. Without -s, -a reports names from every location but does not try to merge duplicates into a comparison.

This is a diagnostic, not a clean-up tool. toe does not edit, delete or select the active TERM entry. Duplicates look wrong? Preserve the report and inspect the owning package or source database before changing any files.

5. Inspect terminfo dependencies when maintaining source

-u and -U take a terminfo entry source or termcap database file, not a compiled directory, and report relationships made through use or tc:

$ /usr/bin/toe -u /path/to/terminfo-source
$ /usr/bin/toe -U /path/to/terminfo-source
  • -u lists each primary entry that uses another entry, followed by the names it uses.
  • -U reverses that view: it lists an entry named in a use or tc capability, followed by the primary entries that name it.

Empty output can simply mean the source file has no relationships of that kind. Do not point either form at /usr/share/terminfo and expect a dependency report: that path is a compiled database directory, while these options parse source text. Keep source files in a controlled working area, and treat any file someone else hands you as untrusted input.

6. Use verbose output only while diagnosing a lookup

-v writes progress information to standard error. Its optional number runs from 1 to 10, interpreted like the tracing level tic uses:

$ /usr/bin/toe -v1 /usr/share/terminfo > /dev/null
$ printf '%s\n' "$?"
0

Tracing helps when you are investigating a search path, but it is noisy and depends on how ncurses was built; if ncurses has no tracing support the number is simply ignored. Keep normal scripts focused on standard output and the exit status rather than parsing verbose diagnostics.

Done means

  • Version confirmed: you checked the executable and ncurses version before comparing results.
  • Entries listed: you can list and sort available terminal descriptions with toe and -s.
  • Search path visible: you can show searched directories with -h and compare all locations with -as.
  • Source vs database clear: you know -u and -U read source files, not compiled terminfo directories.
  • Nothing changed: no command touched a terminal database, service, boot setting or any file outside an explicitly redirected report.