Configuration file

MrTerminal keeps everything in one JSON file, ~/.mrterminal/config.json. That covers projects, the terminals open in each and their layout, presets, custom commands, names given to scripts, and settings. It is described by a JSON Schema: config.schema.json. The file links to it with $schema, so editors and agents can look up every field.

Edit it only while MrTerminal is closed. While it runs, the app owns the file and rewrites it within a second of any change. Make changes through mrt instead. When the app starts it reads the file and tidies it: missing fields get defaults, unknown fields are dropped, and projects whose folder is gone are removed.

mrt config path     # where it is
mrt config show     # what is in it
mrt config schema   # the JSON Schema

A hand-written preset

Only the terminals are needed. A null layout tiles them, and launching the preset gives each a fresh id and reuses any open terminal with the same command and folder.

{
  "id": "p1",
  "name": "Full stack",
  "layout": null,
  "terminals": [
    { "id": "1", "title": "web", "cwd": "/Users/me/code/shop/web", "command": "pnpm dev" },
    { "id": "2", "title": "api", "cwd": "/Users/me/code/shop/api", "command": "make run" }
  ]
}

Config

~/.mrterminal/config.json: projects, their open terminals, layouts, presets and commands, and app settings. While MrTerminal runs it owns this file and rewrites it within a second of any change, so edit it only while the app is closed; with the app running, use the `mrt` command instead. Missing fields get defaults and unknown fields are dropped on load.

FieldTypeMeaning
version * 1 Format version.
settings Settings
projects * Project[] Projects in sidebar order.
activeProjectId string | null Id of the project on screen.
sidebarWidth number Sidebar width in pixels. Default: 280.
sidebarHidden boolean Default: false.
sidebarCompact boolean Project cards show only their name, without the folder path. Default: false.
globalCommands GlobalCommand[] Commands offered in every project from the arrow next to + Terminal, such as coding agents. Seeded with the agents found on first launch (claude, codex, cursor-agent, agy, grok).
window object Window position and size; written by the app.

Settings

FieldTypeMeaning
restoreOnLaunch "ask" | "resume" | "layout" | "fresh" What happens to the previous session's terminals at start: ask every time; resume (reopen and re-run every command); layout (reopen, leave commands typed at the prompt); fresh (start empty). Default: "ask".
shell string | null Absolute path of the shell to launch; null for the user's login shell. Default: null.
fontSize number Default: 13.
showRunning boolean List what is running under each project in the sidebar. Default: true.
editor string | null Editor the top bar's Open button uses: cursor, vscode, vscode-insiders, windsurf, zed, sublime, webstorm, idea, pycharm, goland, rider, android-studio or fleet. null = the first one installed. Default: null.
terminalCommand string | null Id of the global command the top bar's terminal button starts (the one picked last from its menu). null = a plain shell. Default: null.
fontFamily string | null Terminal font family; null for the built-in monospace font. Default: null.
theme "midnight" | "dracula" | "nord" | "solarized-dark" | "daylight" | "solarized-light" Default: "midnight".

Project

A folder whose scripts MrTerminal offers to run.

FieldTypeMeaning
id * string Stable id, e.g. 8 random hex characters.
name string Name in the sidebar; defaults to the path.
path * string Absolute path of the project folder. Projects whose folder no longer exists are dropped.
terminals Terminal[] Terminals open right now, in no particular order. This is what is restored at the next start.
layout object | null Dockview layout (splits, tabs, sizes) referring to terminal ids. Optional: terminals missing from it are tiled automatically, so null is always safe.
customCommands CustomCommand[] Commands the user added that are not in any script file.
presets Preset[] Saved sets of terminals that open together in one click.
aliases object Names given to detected scripts. Key: the folder relative to the project ('' for the root), a newline, then the command line, e.g. "\nnpm run dev" or "web\npnpm run dev".
expanded boolean The project's card is unfolded in the sidebar. Default: true.
color string The project's colour; assigned automatically when missing.

GlobalCommand

A command run in a new terminal in the project's folder, or typed into the terminal on screen.

FieldTypeMeaning
id * string Unique among global commands. Built-in agents use claude, codex, cursor, antigravity, grok.
name * string Shown in the menu and as the tab title.
command * string The command line: a program name or full path, and any arguments, e.g. "claude --resume".
hidden boolean Kept in Settings but left out of the menu. Default: false.

Terminal

A terminal: the user's shell started in `cwd`, with `command` typed into it. A command's identity is command + cwd; that is how sidebar entries, presets and aliases find their terminal.

FieldTypeMeaning
id * string Unique among all terminals; also its id for `mrt` and its MRT_TERMINAL_ID.
title * string Tab title.
cwd * string Absolute folder the shell starts in.
command string Command line typed into the shell on start. Absent for a plain shell.
resume string Command line that was running in the terminal (typed by hand or not) when the app quit; it runs again on the next launch in place of `command`. Kept up to date by the app.
last string The last command line that ran in the terminal long enough to show as running (typed by hand, from the sidebar or by an agent through mrt). Kept after it stops: restarting a terminal opened without `command`, the project's play button and the next launch run it again. Kept up to date by the app.
lastCwd string The folder `last` started in, which can differ from `cwd` (a command line that does `cd web && ...`, or a command typed in a terminal opened for another script). Running `last` again starts there. Kept up to date by the app.

CustomCommand

FieldTypeMeaning
id * string
name * string
command * string
cwd string Folder to run in: relative to the project, absolute, or starting with ~. Absent for the project root.

Preset

FieldTypeMeaning
id * string
name * string
terminals * Terminal[] Terminals to open. Ids only need to be unique within the preset; launching gives each a fresh id, and reuses an open terminal with the same command and cwd.
layout object | null Dockview layout referring to the ids in `terminals`; null tiles them automatically.