diff --git a/macos/Sources/Features/Terminal/BaseTerminalController.swift b/macos/Sources/Features/Terminal/BaseTerminalController.swift index c1c350f9d..4298dd1e6 100644 --- a/macos/Sources/Features/Terminal/BaseTerminalController.swift +++ b/macos/Sources/Features/Terminal/BaseTerminalController.swift @@ -240,7 +240,12 @@ class BaseTerminalController: NSWindowController, // Move focus to the target surface and activate the window/app DispatchQueue.main.async { - Ghostty.moveFocus(to: view, from: self.focusedSurface) + // We suppress the spurious unfocus signal by passing nil for `from` + // when the surface is already the logically focused one. + Ghostty.moveFocus( + to: view, + from: (self.focusedSurface == view) ? nil : self.focusedSurface + ) view.window?.makeKeyAndOrderFront(nil) if !NSApp.isActive { NSApp.activate(ignoringOtherApps: true)