From 8fa5a9d29983f3940b2049c9452453da1e7e18c9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 26 Mar 2023 10:43:57 -0700 Subject: [PATCH] macos: Cmd+W closes settings window if focused --- macos/Sources/GhosttyApp.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) }