From ddaf307cf7a6304b4376fb98e94e614369c46f1d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 12 Dec 2025 14:05:46 -0800 Subject: [PATCH] macos: more strict detection for tab context menu We were accidentally modifying the "View" menu. --- .../Features/Terminal/Window Styles/TerminalWindow.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift index d04d7001c..160473328 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift @@ -708,8 +708,8 @@ extension TerminalWindow { private func isTabContextMenu(_ menu: NSMenu) -> Bool { guard NSApp.keyWindow === self else { return false } - // These are the target selectors, at least for macOS 26. - let tabContextSelectors: Set = [ + // These selectors must all exist for it to be a tab context menu. + let requiredSelectors: Set = [ "performClose:", "performCloseOtherTabs:", "moveTabToNewWindow:", @@ -717,7 +717,7 @@ extension TerminalWindow { ] let selectorNames = Set(menu.items.compactMap { $0.action }.map { NSStringFromSelector($0) }) - return !selectorNames.isDisjoint(with: tabContextSelectors) + return requiredSelectors.isSubset(of: selectorNames) } private func appendTabModifierSection(to menu: NSMenu, target: TerminalController?) {