From 8437be8ee1e593afaff96f4d702cdce12e97cecd Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Tue, 11 Nov 2025 11:30:44 +0100 Subject: [PATCH] macOS: 'restore' non native fullscreen styles --- .../Features/Terminal/TerminalRestorable.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/macos/Sources/Features/Terminal/TerminalRestorable.swift b/macos/Sources/Features/Terminal/TerminalRestorable.swift index 1e640967e..56fa48d55 100644 --- a/macos/Sources/Features/Terminal/TerminalRestorable.swift +++ b/macos/Sources/Features/Terminal/TerminalRestorable.swift @@ -109,6 +109,17 @@ class TerminalWindowRestoration: NSObject, NSWindowRestoration { } completionHandler(window, nil) + // We don't restore the previous fullscreen mode. If the saved mode differs from + // the current configuration, using either could be confusing. Instead, we honor + // the configured mode (consistent with new_window behavior). + let mode = appDelegate.ghostty.config.windowFullscreenMode + guard mode != .native else { + // We let AppKit handle native fullscreen + return + } + // Give the window to AppKit first, then adjust its frame and style + // to minimise any visible frame changes. + c.toggleFullscreen(mode: mode) } /// This restores the focus state of the surfaceview within the given window. When restoring,