Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

settings.json

~/.termherd/settings.json                     (macOS, Linux)
%USERPROFILE%\.termherd\settings.json         (Windows)

Changes apply as soon as the file is saved — no restart, no session lost. The settings panel changes the appearance from inside the app and saves it here.

The annotated template with every option, its default and its meaning is docs/settings.example.jsonc — copy the blocks you want and strip the comments. The real file is strict JSON: no comments, no trailing commas.

How it loads

Read at startup, then again each time the file changes on disk — whoever wrote it: your editor, an MCP set_option, the settings panel. Defensively, both times:

  • Every field is optional. A missing file, a missing field, or a corrupt file falls back to built-in defaults — settings never block startup.
  • A file that is not valid JSON is set aside as settings.json.corrupt-1 (then -2, …) and the sidebar says so, so nothing TermHerd saves later can overwrite what you wrote. Fix the copy and move it back. metadata.json is protected the same way.
  • Out-of-range values clamp instead of failing the file.
  • One bad value — a typo’d colour, an unknown action name — degrades alone with a logged warning. The rest of the file still applies.
  • While the app runs, a file that does not parse — a save your editor has only half written, a missing brace — changes nothing: the running settings stay until the next valid save. Nothing falls back to defaults mid-run, and nothing is set aside.

What a live change reaches:

SettingApplies to
theme, terminal.colorsthe chrome and every open terminal, at once
keys, close, sidebar, open, mcp.allow_claude_nesting, capture, terminal.copy_on_select, terminal.paste_on_right_click, terminal.option_as_metathe next keypress, click or call
terminal.font_sizeevery terminal, at once (your zoom steps are kept on top)
shellthe next session you open — a running one keeps its program
recordthe next recording — one in progress keeps its budget
mcp.attachthe next launch — the published endpoint is decided at startup

A program that read the terminal’s colours when it started — Claude Code picks its light or dark look that way — keeps its choice until it restarts.

Three neighbouring files are TermHerd’s, not yours to edit: window.json (size and position — a position left off every connected monitor is dropped, so the window re-centers instead of opening out of reach), layout.json (the tab strip a launch reopens) and metadata.json (stars, archives, custom titles, and the repositories you added by hand).

Options

shell

The program launched for each session. Omit the block, or set it to null, for the platform default login shell. args is optional.

"shell": { "program": "pwsh", "args": [] }

Naming your shell here has a side effect worth knowing: bash and fish get their OSC 133 shell-integration snippet — and therefore an accurate activity status — only when named explicitly. See Status and attention.

theme

The GUI chrome: sidebar, tab strip, buttons. "dark" by default; an unknown value falls back to it. While terminal.colors.scheme is unset, or names no scheme, the terminals follow the theme too: a ✓ value brings the scheme of the same name, and the table names what the others bring. A scheme you set wins over the theme’s. Both are set live from the settings panel.

theme valuesSame-name colors.schemeTerminal with no scheme set
dark—the built-in palette
light—catppuccin-latte
solarized-dark, solarized-light, gruvbox-dark, gruvbox-light✓the same name
dracula, nord✓the same name
catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha✓the same name
tokyo-night, tokyo-night-storm, tokyo-night-light✓the same name
kanagawa-wave, kanagawa-dragon✓the same name
kanagawa-lotus— none publishedgruvbox-light
ferra— none publishedthe built-in palette
moonfly, nightfly, oxocarbon✓the same name

Status dots and /color marks are shaded per theme to stay legible, at 3:1 or better. The active tab’s dot is shaded against that tab’s own fill, so it reads there too.

close

Per-action close confirmation. Both keys default to "confirmWhenActive".

"close": { "tab": "confirmWhenActive", "app": "confirmWhenActive" }
ValueBehaviour
alwaysConfirmalways ask
confirmWhenActiveask only while a session runs a foreground process
noConfirmationnever ask

Unsaved changes in the doc editor make a quit ask under any app value: the policy covers the sessions a quit stops, not text it would lose.

terminal

"terminal": {
  "font_size": 14,
  "copy_on_select": false,
  "paste_on_right_click": false,
  "option_as_meta": "left",
  "colors": {
    "scheme": "solarized-dark",
    "foreground": "#839496",
    "background": "#002b36",
    "cursor": "#839496",
    "palette": ["#073642", "#dc322f", "…16 entries…"]
  }
}
KeyDefaultNotes
font_size14pixels, clamped to 6–40. The zoom chords step from here at runtime without rewriting it.
copy_on_selectfalsea drag release, a double-click or a triple-click copies the selection outright, no chord needed
paste_on_right_clickfalsea right-click pastes into the pane under the pointer, not necessarily the focused one
option_as_meta"left"macOS only: which Option key is Meta — "none", "left", "right" or "both"; the other one types what the layout composes. Another value falls back to "left".
colors.schemethe theme’severy theme value marked ✓, e.g. catppuccin-mocha
colors.foreground / .background / .cursorfrom the scheme"#rrggbb"; the # is optional
colors.palettefrom the schemethe 16 ANSI colours — normal 0–7, then bright 8–15

Every colour field is optional and overrides the scheme it starts from. Fewer than 16 palette entries override the head of the list; entries past 16 are ignored.

"sidebar": { "session_limit": 5 }

Sessions shown per project before the tail folds behind a … N more expander. 0 shows every session.

record

The GIF screencast budget (Cmd/Ctrl+Shift+R). Values clamp: fps 1–60, max_seconds 1–600, scale 0.1–1.0.

"record": { "fps": 8, "max_seconds": 30, "scale": 0.5 }

capture

Whether a state capture masks the secrets its terminal text shows — access keys, API tokens, Bearer headers, private keys. On by default; a value that is not true or false keeps it on. Turn it off only to debug a capture that masked too much.

"capture": { "redact": true }

mcp

Two keys, both off by default.

allow_claude_nesting: whether the live bridge’s prompt_in_session may prompt another Claude session — one agent driving another. A shell session is never gated. A single call can opt in on its own with allow_claude_nesting: true (see The live bridge, and Orchestrating sessions for the whole loop).

"mcp": { "allow_claude_nesting": false }

attach: whether a running TermHerd publishes its live bridge for a client it did not launch — a script, an editor, or the very terminal you started TermHerd from.

"mcp": { "attach": true }
ValueMeans
falsethe default: nothing is published, and only sessions TermHerd spawned can reach the bridge
true~/.termherd/bridge.json carries { url, token } for the running instance, readable only by you
"never"as false, and the TERMHERD_MCP_ATTACH override below cannot turn it on

attach is read at launch only: changing it while TermHerd runs takes effect at the next start. TERMHERD_MCP_ATTACH=1 (or 0) in TermHerd’s own environment flips true and false for one launch — useful for a one-off automation run without editing the file. Against "never" it does nothing, and says so in the log at info.

Publishing is off by default because of what it exposes: any process running as you can then read the token and drive the workspace, including run_in_session, which types into a terminal. See Attaching from outside for the whole picture and the termherd mcp-config subcommand that consumes the file.

open

The command a Cmd/Ctrl-clicked file path opens in. Omit the block to hand the file to the OS default handler (open / explorer / xdg-open) — the default, which cannot honour a line number.

"open": { "command": "code -g {path}:{line}:{col}" }

Templates: {path} (required), {line}, {col}. A path the terminal printed without a position opens at 1:1, so one command stays well-formed either way.

RuleWhy
Give a GUI editorthe child’s standard streams are closed, so vim would start invisible and unkillable. Reach one through a terminal emulator: ["wezterm", "start", "--", "vim", "+{line}", "{path}"]
Run as argv, never a shellthe string is split on whitespace before {path} is filled in, so a filename with spaces or & can never become a second argument. Use the array form when the program’s own path has spaces
No ~, no shell lookupthe program is spawned directly; write the full path. An app launched from Finder/Explorer inherits a minimal PATH that often lacks code
Windows: code.cmda direct spawn only ever appends .exe, so a bare "code" is not found
A placeholder in the program name is refusedwhat the terminal printed chooses the file, never the executable

An empty command, one without {path}, or one with an unknown placeholder is logged and ignored — the OS handoff applies instead. A command that fails to start raises a desktop notification.

Configuring this also lifts a restriction: with no command, a path the OS would run rather than show (.app, .exe, .desktop) is neither underlined nor opened, because the handoff obeys the file association. An explicit editor consults no association, so those files open like any other.

keys

Keyboard overrides — one chord or a list per action, replacing that action’s default. The full vocabulary and its defaults are in Keyboard shortcuts.

"keys": {
  "copy": "ctrl+y",
  "paste": ["ctrl+shift+v", "shift+insert"],
  "activate-tab-1": "ctrl+1"
}

Reading and writing it from a Claude session

The stdio MCP server exposes a subset of these options as list_options / set_option, so you can ask “what can I configure here?” or “switch me to a light theme” from any Claude session.

The eight ids it covers today: theme, shell.program, shell.args, terminal.colors.scheme, terminal.colors.foreground, terminal.colors.background, terminal.colors.cursor, terminal.colors.palette. Two of them — shell.program and shell.args — are read-only over MCP: they name what TermHerd executes at the next launch, so an agent may read them but never set them. The close, sidebar, record, capture, open, mcp, keys, terminal.font_size, terminal.copy_on_select, terminal.paste_on_right_click and terminal.option_as_meta blocks are file-only for now; keys is published as a read-only resource.

mcp is file-only by design rather than by backlog: its keys govern who may reach the live bridge and what it may do there, and a surface able to widen its own reach is not a setting.

A set_option write lands in settings.json and applies as soon as it is written, like any other edit to the file.

A complete example

{
  "shell": { "program": "/bin/zsh" },
  "theme": "dark",
  "close": { "tab": "confirmWhenActive", "app": "alwaysConfirm" },
  "terminal": {
    "font_size": 15,
    "copy_on_select": true,
    "paste_on_right_click": true,
    "option_as_meta": "left",
    "colors": { "scheme": "gruvbox-dark" }
  },
  "sidebar": { "session_limit": 0 },
  "record": { "fps": 10, "max_seconds": 20, "scale": 0.5 },
  "capture": { "redact": true },
  "open": { "command": "code -g {path}:{line}:{col}" },
  "mcp": { "allow_claude_nesting": false, "attach": false },
  "keys": {
    "toggle-sidebar": "ctrl+alt+b",
    "focus-next": "ctrl+alt+right"
  }
}