From f5bddb346c2901f87dcf8447d8cdcd01384adaf5 Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Mon, 10 Nov 2025 17:54:46 +0100 Subject: [PATCH] macOS: support `close_all_windows` action --- macos/Sources/Ghostty/Ghostty.App.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/macos/Sources/Ghostty/Ghostty.App.swift b/macos/Sources/Ghostty/Ghostty.App.swift index 466e7859d..9c19199e8 100644 --- a/macos/Sources/Ghostty/Ghostty.App.swift +++ b/macos/Sources/Ghostty/Ghostty.App.swift @@ -604,7 +604,8 @@ extension Ghostty { scrollbar(app, target: target, v: action.action.scrollbar) case GHOSTTY_ACTION_CLOSE_ALL_WINDOWS: - fallthrough + closeAllWindows(app, target: target) + case GHOSTTY_ACTION_TOGGLE_TAB_OVERVIEW: fallthrough case GHOSTTY_ACTION_TOGGLE_WINDOW_DECORATIONS: @@ -878,6 +879,11 @@ extension Ghostty { } } + private static func closeAllWindows(_ app: ghostty_app_t, target: ghostty_target_s) { + guard let appDelegate = NSApplication.shared.delegate as? AppDelegate else { return } + appDelegate.closeAllWindows(nil) + } + private static func toggleFullscreen( _ app: ghostty_app_t, target: ghostty_target_s,