From 231f6f4c75f02531ae385c22c2b8ad81f53d1555 Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Sat, 25 Apr 2026 19:55:28 +0200 Subject: [PATCH] macOS: move the restoration logs --- macos/Sources/App/macOS/AppDelegate.swift | 2 -- macos/Sources/Features/Terminal/TerminalRestorable.swift | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/macos/Sources/App/macOS/AppDelegate.swift b/macos/Sources/App/macOS/AppDelegate.swift index d4804cfe0..da554ba62 100644 --- a/macos/Sources/App/macOS/AppDelegate.swift +++ b/macos/Sources/App/macOS/AppDelegate.swift @@ -859,8 +859,6 @@ class AppDelegate: NSObject, } func application(_ app: NSApplication, willEncodeRestorableState coder: NSCoder) { - Self.logger.debug("application will save window state") - guard ghostty.config.windowSaveState != "never" else { return } // Encode our quick terminal state if we have it. diff --git a/macos/Sources/Features/Terminal/TerminalRestorable.swift b/macos/Sources/Features/Terminal/TerminalRestorable.swift index 495a6b61f..f3a166420 100644 --- a/macos/Sources/Features/Terminal/TerminalRestorable.swift +++ b/macos/Sources/Features/Terminal/TerminalRestorable.swift @@ -21,6 +21,12 @@ extension TerminalRestorable { static var selfKey: String { "state" } static var versionKey: String { "version" } + private var debugDescription: String { + withUnsafePointer(to: self) { ptr in + "<\(ptr)>[version: \(Self.version)]" + } + } + /// Default implementation returns nil (no custom base config). var baseConfig: Ghostty.SurfaceConfiguration? { nil } @@ -45,6 +51,8 @@ extension TerminalRestorable { func encode(with coder: NSCoder) { coder.encode(Self.version, forKey: Self.versionKey) coder.encode(CodableBridge(self), forKey: Self.selfKey) + + AppDelegate.logger.debug("saved terminal state: \(debugDescription)") } }