Skip to content
Logo

Ghostty Integration

Boo embeds GhosttyKit as a static library via the C API. This provides complete terminal emulation with Metal GPU-accelerated rendering.

Capabilities

  • Complete VT/xterm escape sequence parsing
  • Metal GPU-accelerated rendering
  • Proper font shaping and text rendering
  • Kitty keyboard protocol and graphics protocol
  • Mouse tracking, scrollback with reflow
  • Full TUI support (vim, lazygit, htop, etc.)

How It Works

Lifecycle

  1. GhosttyRuntime — singleton initialized at app launch, calls ghostty_init() and ghostty_app_new()
  2. GhosttyView — creates a ghostty_surface_t per terminal tab (Metal rendering surface)
  3. Wakeup/tick loop — Ghostty queues messages internally; the wakeup_cb callback dispatches ghostty_app_tick() on the main thread to drain them

Event Callbacks

Ghostty surfaces emit action callbacks for terminal state changes:

ActionTrigger
GHOSTTY_ACTION_PWDShell cd (via OSC 7)
GHOSTTY_ACTION_SET_TITLETerminal title change
GHOSTTY_ACTION_SHOW_CHILD_EXITEDShell process exited

These flow through: GhosttyView → PaneView delegate → MainWindowController → TerminalBridge + sidebar update.

Shell Integration

Ghostty injects shell hooks so the shell emits OSC 7 on cd. The Makefile bundles Vendor/ghostty/zig-out/share/ghostty/ as ghostty-resources/ next to the executable.

Configuration

applyBooSettings(to:) writes Boo's theme/font settings to a temp Ghostty config. The user's own Ghostty config at ~/Library/Application Support/com.mitchellh.ghostty/config is also loaded.