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
GhosttyRuntime— singleton initialized at app launch, callsghostty_init()andghostty_app_new()GhosttyView— creates aghostty_surface_tper terminal tab (Metal rendering surface)- Wakeup/tick loop — Ghostty queues messages internally; the
wakeup_cbcallback dispatchesghostty_app_tick()on the main thread to drain them
Event Callbacks
Ghostty surfaces emit action callbacks for terminal state changes:
| Action | Trigger |
|---|---|
GHOSTTY_ACTION_PWD | Shell cd (via OSC 7) |
GHOSTTY_ACTION_SET_TITLE | Terminal title change |
GHOSTTY_ACTION_SHOW_CHILD_EXITED | Shell 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.
