testingterm
These docs were written by an AI agent. They were checked against the code, but may still contain mistakes; when in doubt, trust testingterm --help and the types.

Themes

Every Ghostty and Rex theme, your own terminal's theme, or custom colors.

The theme decides the colors programs' ANSI colors map to, the background and foreground, and the cursor, which matters for screenshots and for asserting colors with styles().

By name

launch("htop", { theme: "Dracula" });
launch("htop", { theme: "catppuccin mocha" });
launch("htop", { theme: "Merino Dark" });

testingterm bundles all of Ghostty's themes (over 600) and Rex's built-in themes, plus its own dark (default) and light. Names ignore case and spaces; a typo gets suggestions. List them with testingterm themes, or testingterm themes nord to filter. In TypeScript the names autocomplete.

Prefix ghostty: or rex: to pick from one collection when names collide, for example rex:merino-dark.

Your own terminal's theme

launch("htop", { theme: "ghostty" });
launch("htop", { theme: "rex:light" });
  • "ghostty" reads your Ghostty config: the usual config files, every config-file include, theme files in your themes folders, background / foreground / palette overrides, and font-size. A light:X,dark:Y theme follows the system appearance; add :light or :dark to choose.
  • "rex" uses the theme Rex is set to for the current appearance (macOS).

Screenshots then look like the user's own terminal.

Custom colors

launch("htop", {
  theme: {
    base: "Nord",
    background: "#000000",
    cursor: "#88c0d0",
    palette: { 1: "#ff5555", 208: "#ff8700" },
  },
});

palette is an array for colors 0, 1, 2, ... or an object for any of the 256. Anything left out comes from base (default dark).

Switching while running

await term.setTheme("Tokyo Night");
await term.setTheme({ base: "Dracula", background: "#101010" });

From the CLI: testingterm theme "Gruvbox Dark", or testingterm theme --base Nord --background "#000000". For a whole run: testingterm run --theme light or TESTINGTERM_THEME=light.