From bc50714ce9388a2756f0d835c8509f2b1918650c Mon Sep 17 00:00:00 2001
From: Lukas <134181853+bo2themax@users.noreply.github.com>
Date: Wed, 29 Apr 2026 19:48:24 +0200
Subject: [PATCH 1/7] macOS: provide means to restore menu shortcuts
---
macos/Sources/App/macOS/AppDelegate.swift | 12 ++++++++++
macos/Sources/App/macOS/MainMenu.xib | 15 ++++--------
.../Ghostty/Ghostty.MenuShortcutManager.swift | 23 +++++++++++++++++++
3 files changed, 40 insertions(+), 10 deletions(-)
diff --git a/macos/Sources/App/macOS/AppDelegate.swift b/macos/Sources/App/macOS/AppDelegate.swift
index a971df9ba..038eda1c5 100644
--- a/macos/Sources/App/macOS/AppDelegate.swift
+++ b/macos/Sources/App/macOS/AppDelegate.swift
@@ -1128,6 +1128,18 @@ extension AppDelegate {
self.menuFindParent?.setImageIfDesired(systemSymbolName: "text.page.badge.magnifyingglass")
}
+ /// Save restorable menu items for later
+ ///
+ /// If you plan to add more items here, make sure you add the default shortcut in MainMenu.xib
+ @MainActor private func saveRestorableMenuItems() {
+ [
+ menuUndo, menuRedo,
+ menuCopy, menuPaste, menuSelectAll,
+ ]
+ .compactMap { $0 }
+ .forEach(menuShortcutManager.saveRestorableMenuItem(_:))
+ }
+
/// Sync all of our menu item keyboard shortcuts with the Ghostty configuration.
@MainActor private func syncMenuShortcuts(_ config: Ghostty.Config) {
guard ghostty.readiness == .ready else { return }
diff --git a/macos/Sources/App/macOS/MainMenu.xib b/macos/Sources/App/macOS/MainMenu.xib
index 30cd985db..60413559b 100644
--- a/macos/Sources/App/macOS/MainMenu.xib
+++ b/macos/Sources/App/macOS/MainMenu.xib
@@ -223,27 +223,23 @@