diff --git a/macos/Sources/Features/Terminal/TerminalRestorable.swift b/macos/Sources/Features/Terminal/TerminalRestorable.swift index c80818b0a..7b70220b4 100644 --- a/macos/Sources/Features/Terminal/TerminalRestorable.swift +++ b/macos/Sources/Features/Terminal/TerminalRestorable.swift @@ -125,6 +125,13 @@ class TerminalWindowRestoration: NSObject, NSWindowRestoration { guard viewWindow == inWindow else { return } inWindow.makeFirstResponder(to) + + // If the window is main, then we also make sure it comes forward. This + // prevents a bug found in #1177 where sometimes on restore the windows + // would be behind other applications. + if (viewWindow.isMainWindow) { + viewWindow.orderFront(nil) + } } } }