The metadata has instructions.
Terminfo maps terminal capabilities to Boolean values, numbers, and strings. Screen programs use those records to pick the right control sequence for cursor movement, color, clearing, and other terminal operations. The ncurses manual documents the database and the API that reads it.[2]
The string form is more than a byte lookup. Parameter expansion can push constants and arguments, store values in registers, perform arithmetic, choose conditional branches, and print results. Uppercase registers can persist across expansions inside one process.[1]
A terminal capability can be data at rest and a small program when expanded.
The host process supplies the loop.
Nicolas Seriot compiled a two-counter Minsky machine into the cup cursor-addressing capability. One expansion executes one machine step. Repeated calls provide the clock that the capability language does not contain itself.[1]
The showpiece changes the terminal type and runs /usr/bin/top. On Seriot's setup, a cursor movement used during the clock redraw advances a Fibonacci calculation. The capability also writes the current result into the terminal window title. The exact cursor coordinate depends on the layout and terminal size, so this is a constructed demonstration rather than a portable feature of top.
The ncurses API explains the handoff. An application loads a terminal description, passes parameterized strings through tparm, then sends the result to the terminal with an output function such as tputs.[3] That path gives the inspection order: loaded entry, expanded capability, host trigger, emitted bytes.
The stunt is not a shell.
Seriot is explicit about the security boundary. His Fibonacci capability does not open files, execute commands, or make system calls. It produces terminal output through the operations that terminfo expansion already supports. He does not present it as a privilege-escalation exploit.[1]
The useful lesson is narrower. A user-controlled terminfo record can be interpreted repeatedly inside another process. A parser or evaluator flaw would be a separate issue. Terminal output can also change visible state such as a title. Keep those facts separate from claims about command execution or elevated access.
Inspect the lookup before the spectacle.
The terminfo manual says TERM names the terminal type. Seriot notes that tic commonly installs a user entry under ~/.terminfo, while TERMINFO can point lookup at another directory. That means the profile name alone is not a complete record. Capture the resolved entry and the environment that selected it.
Start with read-only commands. Print TERM, inspect the compiled entry with infocmp, and record the host program that consumes it. If an agent changes terminal setup, review the source entry before compiling it. Do not execute a downloaded demo merely to prove that the syntax exists.