Files
ghostty/macos/Sources/App/macOS/AppDelegate+Ghostty.swift
2026-02-20 19:42:48 -05:00

22 lines
593 B
Swift

import AppKit
// MARK: Ghostty Delegate
/// This implements the Ghostty app delegate protocol which is used by the Ghostty
/// APIs for app-global information.
extension AppDelegate: Ghostty.Delegate {
func ghosttySurface(id: UUID) -> Ghostty.SurfaceView? {
for window in NSApp.windows {
guard let controller = window.windowController as? BaseTerminalController else {
continue
}
for surface in controller.surfaceTree where surface.id == id {
return surface
}
}
return nil
}
}