From e47e7a8b8bcd31adcebf8ce49f23c4c61a5604f2 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 29 Sep 2024 09:31:48 -0700 Subject: [PATCH] macos: quick terminal always brings Ghostty to the front --- .../Features/QuickTerminal/QuickTerminalController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift b/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift index f5d899e76..ce62c7c04 100644 --- a/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift +++ b/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift @@ -136,6 +136,12 @@ class QuickTerminalController: BaseTerminalController { private func animateWindowIn(window: NSWindow, from position: QuickTerminalPosition) { guard let screen = ghostty.config.quickTerminalScreen.screen else { return } + // If our application is not active, then we grab focus. The quick terminal + // always grabs focus. + if !NSApp.isActive { + NSApp.activate(ignoringOtherApps: true) + } + // Move our window off screen to the top position.setInitial(in: window, on: screen)