native Ghostty workflow · macOS

Ghostty + rz

Keep Ghostty's native tabs and splits for daily work, then save named snapshots that restore the workspace after Ghostty is completely closed.

Daily shortcuts

⌘ FSearch native scrollback
⌘ GMove to the next search result
⌘ ⇧ GMove to the previous search result
⌘ ⇧ PFind a terminal by title or working directory
⌘ ⇧ `Toggle the scratch terminal while Ghostty is focused
⌘ ⇧ EOpen a complete scrollback export for saving
⌘ ZRestore a recently closed tab or split

One-shot split navigation

Press ⌘ ⇧ Space, then one key. Use h, j, k, or l to move; n for a tab; v to split right; or s to split down. Ghostty exits the mode after the action.

Save before quitting

rz --save work                 # full snapshot with scrollback
rz --save work --no-scrollback # faster snapshot
rz --save work --current-window # only the front Ghostty window
rz --save personal             # a separate named workspace
Measured timeSnapshot
about 2.21sFull snapshot, 8 tabs and 14 surfaces
about 1.06sFast snapshot without scrollback capture
Why full saves take longer Ghostty exposes scrollback through synchronous AppleScript actions. Surfaces are captured concurrently where possible, but exporting text from every terminal remains the expensive part.

Restore after reopening Ghostty

rz                    # newest snapshot overall
rz --session work     # newest snapshot named work
rz --list             # inspect available snapshots
rz --session work --dry-run

rz restores window position and size, tabs, terminal counts, focus, working directories, exact Codex conversation IDs, and any captured scrollback.

Automatic, without a global service

Start a watcher from the shell that should own it. It saves immediately, then repeats at the requested interval. The watcher uses fast snapshots without scrollback and stops when its owning shell or Ghostty tab exits.

rz --watch backup --every 15m
rz --watch-status
rz --watch-stop
Current window by default The watcher binds the front Ghostty window ID when it starts. Moving focus later does not change which window it saves. Use --all-windows only when that broader scope is intentional.
rz --watch backup --every 30m --all-windows

Intervals accept seconds, minutes, or hours, such as 30s, 15m, or 1h, with a ten-second minimum. Watcher state and logs live in ~/.local/state/ghostty-rz/watchers. Snapshots accumulate until you remove them; the watcher does not prune previous backups automatically.

Inspect or repair the live workspace

The launcher claims existing tabs by working directory and creates only missing ones. It does not inject commands into an existing terminal.

Guaranteed read-only preview

osascript ~/dot-files/ghostty/scripts/workspace-open.applescript --dry-run

Ensure declared tabs and print the inventory

osascript ~/dot-files/ghostty/scripts/workspace-open.applescript
osascript ~/dot-files/ghostty/scripts/workspace-inventory.applescript

macOS choices

  • Native titlebar tabs and restored window state.
  • AppleScript support for inspection and snapshots.
  • Exact pixel resizing instead of cell-step resizing.
  • Secure-input indication during password entry.
  • macOS shortcuts denied so configured Ghostty bindings win.
  • An instant scratch terminal at 35% of screen height.

Honest restoration limits

  • Ghostty exposes terminal surfaces, not split trees or pane proportions.
  • Additional surfaces therefore restore as right-hand splits.
  • Scrollback replays as plain text, not as a running process.
  • Codex resumes from its conversation ID; arbitrary programs cannot be reconstructed.
  • Window geometry needs macOS Accessibility permission for the shell that runs rz.
  • A window-scoped snapshot restores that saved window into one new Ghostty window.
The safe boundary Every restore creates new Ghostty windows. It does not close, rename, rearrange, or replace tabs that already exist.

Source files

  1. ghostty/config - commented Ghostty configuration
  2. ghostty/scripts/rz - snapshot save, selection, and restore
  3. snapshot-capture.applescript - live Ghostty and scrollback capture
  4. workspace-open.applescript - idempotent workspace repair
  5. workspace-inventory.applescript - read-only TSV inventory