Environment flags

Brief

A handful of TD_ variables change how a Terminal Delight window starts. The ones you might set yourself: TD_SCRATCH=1 for a throwaway window that doesn't touch your session, TD_NO_SESSIOND=1 to run without the session host, TD_SPINE=0 to hide the attention rail, and TD_THEME or TD_SKIN to load a theme or skin file from somewhere else.

Three more are set for you, in every pane the session host starts: TD_SESSION, TD_PANE_ID and TD_TAG. A script or an agent reads them to know which window and which pane it is in.

The rest are for debugging, for photographing the app with made-up data, or for the test suite. Any variable ending in DEBUG also keeps the window's error output out of its log file, so a trace of your keystrokes never lands on disk.

Technical lists every variable, what it does and its default.

Technical

Variables

Every variable here is read when the process starts. Changing one means starting a new window.1

At launch#

VariableDoesDefault
TD_SCRATCHA throwaway window: one terminal, no session claimed, nothing saved.off; set to anything means on
TD_SEED_CWDStart that throwaway window's terminal in this directory. Implies TD_SCRATCH.none
TD_SEED_RESUMEType this line into that terminal, usually a claude --resume …. Implies TD_SCRATCH. Tearing a pane off into its own window sets these three for the new window.none
TD_NO_SESSIONDRun without the session host: the window owns its terminals, and they close with it.host on; 1, on, true or yes turns it off
TD_SESSIONOpen this session, ahead of any other rule. Inside a pane it is already set to that pane's session (below).chosen from the workspace
TD_SPINEThe attention rail. 0, false or off hides it.on
TD_ANCHOR_TOPKeep the prompt at the top of the pane, whatever the saved setting says.off; 1 or true turns it on
TD_THEMEThe theme file to read and watch. When it is set, no default file is created.~/.config/terminal-delight/theme.toml
TD_SKINThe skin file. When it is set, the skin saved in the session is ignored.~/.config/terminal-delight/skin.toml
TD_PALETTEA colour file laid over the theme. A named file that doesn't exist yet is not an error: the theme's own colours stand until it appears.none
TD_OMARCHY_THEMESWhere to look for Omarchy themes, :-separated. Replaces the usual list./usr/share/omarchy/themes, $OMARCHY_PATH/themes and your own Omarchy theme folders
TD_OMARCHY_HIDDENThe list of Omarchy themes to leave out of the picker, one name per line.~/.config/omarchy/hidden-themes
TD_HOST_SHELLThe program the session host starts in each new pane.your login shell
TD_PAGE_IDLE_SECSSeconds before the headless browser that draws HTML documents shuts down when nothing needs it.300
TD_MPV_AOThe sound output mpv uses for video in documents. null plays every clip silently without looking for a device.mpv's own choice
TD_NOGLASSLeaves the glass layer off every pane: scanlines, bloom and the edge fade. The barrel warp still bends the picture, because it is drawn in a separate pass.off; set means on
TD_NOCANVASLeaves out only the scanlines and the rolling tracking band. The rest of the glass stays.off; set means on
TD_MCPServe MCP on the window's own standard input and output, for a program that started the window with both piped. It starts that one transport and nothing else: whether any pane is visible is still the MCP switch.off; set means on
TD_MCP_WRITETurns writes on for that window. Read only when TD_MCP is set.off; set means on
TD_MCP_SCRIPTEDMarks the window as one a script launched for itself. Without it, the window's control socket refuses the MCP switches (ctl mcp on|off, mcp writes on|off, mcp expose agents|all) and the verbs that act as a person (adopt, tabs, bench, and doc here, beside, close, scroll, notes, note), answering err … nothing changed. See ctl.5off; only 1 counts
TD_AGENT_REST0 turns resting agents off entirely, groups included.5on

Set inside every pane#

VariableHolds
TD_SESSIONThe session this pane belongs to. terminal-delight mcp, surface, ctl and briefing use it to find their window.
TD_PANE_IDThis pane's number. It outlives the shell, and it is the pane <n> in list_panes.
TD_TAGEight random characters, one per session. Lines the workbench types into this pane arrive as [workbench:<tag>], so an agent can tell its operator's line from text it only read.
TERMalacritty when that terminfo entry is installed, otherwise xterm-256color.
COLORTERMtruecolor.

The first three come from the session host, so a window started with TD_NO_SESSIOND doesn't set them. TERM and COLORTERM are set either way.2

When the launcher starts an agent, it puts TD_BRIEFED=1 in front of the line it types. The terminal-delight briefing hook sees it and stays quiet, because that agent was already briefed.2

A command started with terminal-delight restricted run gets a different environment: TD_RESTRICTED=offline-v1, TD_GATEWAY_FD naming its one channel back to Terminal Delight, TERM=dumb, LANG=C.UTF-8 and TMPDIR=/tmp.5

Debugging#

Each prints a trace to standard error: TD_KEYDEBUG (keys), TD_HITDEBUG (clicks), TD_SELDEBUG (selection), TD_BENCHDEBUG (the composer's length, never its text), TD_DOCDEBUG (documents), TD_ANCHORDEBUG (prompt anchoring), TD_RAIL_DEBUG (the attention rail), TD_PICTUREDEBUG (each time a hidden pane lets its pictures go) and TD_LATENCY (keypress to echo, in microseconds).

A window started from the desktop normally sends its errors to ~/.local/state/terminal-delight/logs/window.log. Any variable that starts TD_ and ends DEBUG stops that: standard error stays where it is, because these traces can print what you type and the person who turned one on is reading them already. So debug output never reaches a bug report.4

TD_VERB_PREVIEW shows the typed-verb preview under bench cards. TD_BENCHMIRROR draws the terminal's own text on the workbench face, which is what the question reader is looking at.

Staging and capture#

These open a panel by themselves or fill a window with made-up agents, usage and notes, so a screenshot shows no real work:

  • TD_DEMO, TD_DEMO_STATE (a saved layout to restore; implies scratch), TD_DEMO_SEED, TD_DEMO_LOGOS, TD_DEMO_LOGO_DIR (default ~/.local/share/terminal-delight/demo-logos). Sharing a demo of a layout sets the first two for the window it opens.
  • TD_WALL_DEMO, TD_WALL_THEME (tints the wall's rows with each pane's colours), TD_FOCUS_DEMO, TD_CONFIRM_DEMO, TD_TRAY_DEMO, TD_OSD_DEMO (crt or crawl also opens that section), TD_SAVINGS_DEMO, TD_USAGE_DEMO (choices, zero or unknown pick a variant), TD_GRAVEYARD_DEMO, TD_SPINE_DEMO, TD_WORKBENCH_DEMO, TD_RAIL_TABLE (opens the checkouts table).
  • TD_BAY_DEMO (how far the bay door is open, 0 to 1), TD_IGNITION_FREEZE (holds the power-on flash at a point between 0 and 1).
  • TD_SKIN_ATLAS_HOME and TD_SKIN_SCENE drive the skin preview runner: the first gives it a private folder and switches off the usage collectors, the second opens one panel by name (find, lookup, plugins, notifications, bug, language, help and others).
  • TD_THRESHING_FLOOR_DEMO opens the Threshing Floor; a number selects that seat, and map opens the System Map. TD_CONFIG_DEMO opens the CONFIG menu. TD_TRAY_DEMO also takes pane, panes or design:X,Y. TD_SKIN_SPINE_FIXTURE fills the tab badges with fictional states inside the preview runner.

TD_USAGE_LIVE opens the usage face on your real records. It is for checking the read path, and its picture is never for sharing.

Test rigs#

Two change how a running window behaves, for a person testing a repair path: TD_GUARD_FORCE_MISMATCH=1 makes every check against the session host report a disagreement, and TD_SAVE_FORCE_SKIP=1 stops the window from ever saving. The rest are read only inside the test suite and its measuring rigs: TD_LAB_IN, TD_LAB_OUT, TD_LAB_CHUNKS, TD_LAB_MUTATE, TD_LAB_TIMEOUT_MS, TD_ECHO_MODE, TD_ECHO_FLOOD, TD_ECHO_FLOOD_KIND, TD_ECHO_SAMPLES, TD_ECHO_WATCH_FLOOD, TD_BIN, TD_PROBE_FLOOD, TD_PROBE_SAMPLES, TD_PROBE_REALISTIC, TD_BOUNDARY_STREAM, TD_SNAPSHOT, TD_SNAPSHOT_UNMASKED and TD_DIAG_PANIC_CHILD.3 On 0.5.0 the suite adds TD_POLICY_ENV_TEST_CHILD and TD_XDG_ANYTHING.

Read by scripts, not the binary#

VariableRead byDefault
TD_ASK_WAIT_Sthe agent hooks: how long a question waits for your answer540 seconds
TD_INBOUND_CAPthe agent hooks: when the inbound journal rotates2 MiB
TD_SAVINGS_USD_PER_Mthe lean-ctx plugin: dollars per million tokens saved5.0

The hooks also read TD_SESSION and TD_PANE_ID to find the pane they run in.6

Names nothing reads#

TD_SOUNDS is read nowhere. The AppImage's launcher still exports it, pointing at the bundled sounds, but the finish bell's sound is built into the binary. TD_FXDEBUG is read nowhere either.6

Other variables it reads#

HOME, PATH, XDG_CONFIG_HOME, XDG_STATE_HOME, XDG_CACHE_HOME, XDG_DATA_HOME, XDG_DATA_DIRS and XDG_RUNTIME_DIR place its files (see Config files). WAYLAND_DISPLAY, HYPRLAND_INSTANCE_SIGNATURE and OMARCHY_PATH tell it about the desktop. XDG_CURRENT_DESKTOP and XDG_SESSION_TYPE go into a bug report's System section. CLAUDE_CONFIG_DIR and CODEX_HOME say where Claude Code and Codex keep their settings. TERMINFO and TERMINFO_DIRS decide whether the alacritty terminfo entry counts as installed.

What would prove this wrong#

A TD_ name read in app/src that is missing from this page, or a name listed here that no code reads. Both are one search away on either branch:

grep -rhoE '"TD_[A-Z0-9_]+"' app/src | sort -u

Sources

  1. Launch reads: main.rs (TD_SCRATCH, TD_SEED_*, TD_NO_SESSIOND, TD_MCP, the demo hooks); the glass: pane.rs and crt.rs; theme, skin and Omarchy paths: theme.rs, skin.rs, palette.rs; documents: docview.rs.
  2. Pane identity: hostproto.rs and host.rs; TERM and COLORTERM: vt/pty.rs; TD_BRIEFED: launcher.rs and briefhook.rs.
  3. The test-only reads sit inside #[test] functions in term.rs, host.rs, gridwire.rs, diag.rs and the test-only module vt/lab.rs.
  4. Debug switches and the log: route_stderr and debug_switch_on in diag.rs.
  5. 0.5.0: TD_MCP_SCRIPTED and the person-acting fence in ctl.rs; TD_AGENT_REST in agentrest.rs; the Restricted environment in restricted.rs; the new capture hooks in main.rs.
  6. Scripts: scripts/td-agent-hooks, plugins/leanctx-mcp/leanctx-mcp; the AppImage launcher that exports TD_SOUNDS: scripts/build-appimage.sh; the built-in bell: bell.rs.