diff --git a/macos/Sources/GhosttyApp.swift b/macos/Sources/GhosttyApp.swift index 1e6fabc43..79f5c3521 100644 --- a/macos/Sources/GhosttyApp.swift +++ b/macos/Sources/GhosttyApp.swift @@ -82,7 +82,11 @@ struct GhosttyApp: App { } func close() { - guard let surfaceView = focusedSurface else { return } + guard let surfaceView = focusedSurface else { + Self.closeWindow() + return + } + guard let surface = surfaceView.surface else { return } ghostty.requestClose(surface: surface) }