Properties3
Is BaseNo
Icon
Order
10Kytos is layered across three components:
| Layer | Component | Responsibility |
|---|---|---|
| Terminal engine | libghostty | Emulation, Metal rendering, PTY, splits |
| Shell chrome | KelyphosKit | Navigator, inspector, utility, NSToolbar |
| Application | Kytos Swift sources | Bridge, session model, persistence, widget |
Key Types
| Type | Role |
|---|---|
KytosGhosttyApp | @Observable @MainActor singleton wrapping ghostty_app_t |
KytosGhosttyView | NSView wrapping ghostty_surface_t — Metal layer, keyboard/mouse, IME |
KytosTerminalRepresentable | NSViewRepresentable bridging KytosGhosttyView into SwiftUI |
KytosWorkspace | @Observable split tree model for one window/tab |
KytosAppModel | Window-to-workspace mapping, persistence, widget snapshots |
Process Model
Kytos runs as a single process. libghostty is linked as a static library (GhosttyKit.xcframework). All terminal rendering happens on the Metal layer managed by KytosGhosttyView. The Swift UI layer runs on the main actor.
Data Flow
Ghostty C callbacks → KytosGhosttyApp → KytosWorkspace → SwiftUI
OSC escape sequences → KytosGhosttyView → toolbar title/subtitle
shell integration scripts → PTY → KytosGhosttyView → navigator labels
widget snapshot → KytosAppModel → JSON file → KytosWidget
