diff --git a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift index 6605bf9ef..e19d6711f 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift @@ -840,29 +840,3 @@ extension TerminalWindow: TabTitleEditorDelegate { makeFirstResponder(focusedSurface) } } - -// MARK: - Tab Clicks - -extension TerminalWindow { - /// Handles a middle-click event to close the tab under the cursor - /// - /// Returns true if the event was handled and should be consumed - func handleTabBarMiddleClick(_ event: NSEvent) -> Bool { - // Require middle click - guard event.type == .otherMouseDown && event.buttonNumber == 2 else { return false } - - // Require tab hit - let screenPoint = convertPoint(toScreen: event.locationInWindow) - guard let hit = tabButtonHit(atScreenPoint: screenPoint) else { return false } - - // Require we have tabs and the index is valid - guard let tabbedWindows = tabbedWindows, - hit.index < tabbedWindows.count else { return false } - - // Find the controller and close it - let targetWindow = tabbedWindows[hit.index] - guard let controller = targetWindow.windowController as? TerminalController else { return false } - controller.closeTab(nil) - return true - } -} diff --git a/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsTahoeTerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsTahoeTerminalWindow.swift index 9e7bbc1c3..6df1b14bc 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsTahoeTerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsTahoeTerminalWindow.swift @@ -76,9 +76,6 @@ class TitlebarTabsTahoeTerminalWindow: TransparentTitlebarTerminalWindow, NSTool return } - // Handle middle-click to close tabs if configured - if handleTabBarMiddleClick(event) { return } - let isRightClick = event.type == .rightMouseDown || (event.type == .otherMouseDown && event.buttonNumber == 2) || diff --git a/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsVenturaTerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsVenturaTerminalWindow.swift index 25a0acc91..fe83fc5fd 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsVenturaTerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TitlebarTabsVenturaTerminalWindow.swift @@ -69,11 +69,6 @@ class TitlebarTabsVenturaTerminalWindow: TerminalWindow { tab.attributedTitle = attributedTitle } - override func sendEvent(_ event: NSEvent) { - if tabBarView != nil && handleTabBarMiddleClick(event) { return } - super.sendEvent(event) - } - override func layoutIfNeeded() { super.layoutIfNeeded()