A session is one terminal — a real PTY running your login shell. Sessions are the reason Fold exists, so they get the main stage and the cheapest keystrokes.
A session owns a tree of panes. Each pane is its own PTY with its own process. One session with three panes is three shells, grouped under one name in the sidebar.
| Action | How |
|---|---|
| New session | ⌘T, or + in the Sessions header |
| Rename | Double-click the name in the sidebar |
| Focus session n | ⌘1 … ⌘9 |
| Kill | Hover the row, click ✕ (confirms first) |
New sessions start in the project root. Renaming is worth doing early — the sidebar is how you'll navigate once several agents are running.
| Action | Key |
|---|---|
| Split right | ⌘D |
| Split down | ⇧⌘D |
| Move focus | ⌘K then ← ↑ → ↓ |
| Close pane | ⌘W, or the hover ✕ |
Splits nest arbitrarily. Drag the divider between two panes to resize them.
⌘W is context-aware: it closes the focused editor tab when the editor has focus, and the focused pane when the terminal does. Closing the last pane in a session closes the session, and every close asks for confirmation first.
The dot beside each name in the sidebar:
| Dot | State |
|---|---|
| Green | Running |
| Grey | Exited with code 0 |
| Red | Exited with a non-zero code — shown beside the name |
A session that has exited stays in the list with its scrollback intact, so you can read what happened. Its panes show an overlay with a restart button.
Sessions with more than one pane show a pane count in the row.
Agents need their control keys — Ctrl+C, Ctrl+R, arrow keys, and everything else. So xterm gets a custom key handler in Fold: ⌘-chords are intercepted by the app, and everything else passes through to the PTY untouched.
That means ⌘T makes a session and ⌘D splits, but Ctrl+C always reaches the process.
⌘+Click in a terminal:
:line and :line:col suffixesPaths are verified on disk before being treated as links, so ordinary text isn't underlined by accident. Hovering a link underlines it.
This is how you jump from an agent's src/foo.ts:42:8 straight to that line.
⌘F with the terminal focused searches the terminal scope of the unified search panel. See Search.
⌥⇥ opens a switcher with two rows — Terminals and Files — and macOS app-switcher semantics: hold ⌥, press ⇥ or ←/→ to step, ↑/↓ to swap rows, release ⌥ to commit.
Fold exports into every session:
| Variable | Value |
|---|---|
FOLD | 1 |
TADA | 1 — kept for pre-rename zshrc blocks |
Gate Fold-specific shell configuration behind FOLD=1 so it doesn't affect your other terminals. See Terminal setup.
PTY output is forwarded as raw bytes on a per-session channel, coalesced on an 8 ms window or a 32 KB cap, whichever comes first. That keeps a chatty agent from flooding the renderer without adding latency you can feel.
On close, a session gets SIGHUP and then SIGKILL after a grace period.