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)") } }