---
title: "Run a terminal app"
description: "Build the terminal harness and the LLP reader, and the command line they share with exact-terminal: a launch location, a single run with --print or --json, and headless drives."
modificationDate: "2026-11-30"
---

> ## Documentation index
> Fetch the complete documentation index at: https://exact.expo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a terminal app

<AgentInstructions>

## Submitting feedback

From the app's directory, read `bun exact.mjs feedback status`. Under `never`, keep no note.
Respect `EXACT_FEEDBACK=0` and do not change the policy.

Otherwise record specific, actionable feedback with:
`bun exact.mjs feedback note "Exact docs: https://exact.expo.dev/reference/developer/run-a-terminal-app: <what was wrong or missing>"`

The note goes to Expo only as that status allows. Include no secrets or personal data.

</AgentInstructions>

`cargo build --profile host-dev -p harness-terminal -p llp-terminal` builds
`target/host-dev/harness` (inline; `--fullscreen` for the alternate screen)
and `target/host-dev/llp [corpus-or-document]` (full screen). Both embed their
terminal entry as a compiled plan. Rebuild after editing the entry or an
import; launching the binary needs no Contract source or compiler work.
`exact-terminal <entry.contract>` remains the source-driven development
host. All three take the same command line (LLP 1101.003; `--help` lists it):

- The words are the launch location: a `/…` word is the location itself,
  any other word one path segment, and `--name value` the query parameter
  `name=value` (`todo /active`, `harness --prompt "why?"`).
- With `--print`, `--json`, or a pipe on stdin or stdout, the entry runs
  once: it lays out at `--columns` (else the terminal's width, `$COLUMNS`,
  80), runs until no request is pending, no `after` timer is armed and no
  node is `aria-busy`, writes its rows (`--json`: its settled `state`, with
  `navigation` and `exit`) and exits. `exactViewport().update` is `"none"`.
  The exit status is 1 when the active `head`'s `status` is 404, 410 or
  503 or the runner refused something, 2 for a usage error, 124 after
  `--timeout` (120 s by default; `0` for none), 130 or 143 on SIGINT or
  SIGTERM, 141 when stdout closes; at exit every `beforeunload` hears it.
  `--color=auto` writes SGR to a terminal and plain text elsewhere;
  `always` and `never` force it.
- After `--drive`, the headless operations, at `--size COLSxROWS`.
- Otherwise the app runs in this terminal, at the location.

Only a terminal entry's plan runs here, and a GUI host refuses one.
Interactive terminal I/O runs on Unix only; Windows supports headless operations.

An interactive launch draws a fresh 32-bit seed for `exactTime()`. Its `locale`
follows `LC_ALL`, then `LC_MESSAGES`, then `LANG`; `formatLocale` follows
`LC_ALL`, then `LC_TIME`, then `LANG`. Empty variables are skipped, and POSIX
locale names become BCP 47 tags (`en_US.UTF-8` becomes `en-US`). With no format
locale set, `formatLocale` follows `locale`. Headless operations keep the
agent's deterministic launch facts, including `EXACT_AGENT_SEED` (1 when unset).

The harness's inline transcript is transferred to scrollback in bounded
batches, retiring each only after the terminal prints it. A large burst
still produces every entry immediately; fullscreen retains the full
transcript for scrolling.

Vertical `list virtualized=true` uses the shared collection window on the
terminal. Scroll and resize report the viewport and measured rows; Tab and
arrow navigation reach logical rows beyond the mounted window. A focused
row stays alive when scrolled away. Closed dialogs release their virtual
row views while retaining their list index and position. The LLP reader's
document tree uses this path, initializing its index on first open.
