From 8b0d4312ee7b6183c829b991f2482c4b52aaf9ac Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 10 Jan 2024 21:28:49 -0800 Subject: [PATCH] macos: invalidate restorable state whenever a terminal window is closed --- macos/Sources/Features/Terminal/TerminalManager.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/macos/Sources/Features/Terminal/TerminalManager.swift b/macos/Sources/Features/Terminal/TerminalManager.swift index 6f00bed18..af85341c6 100644 --- a/macos/Sources/Features/Terminal/TerminalManager.swift +++ b/macos/Sources/Features/Terminal/TerminalManager.swift @@ -190,6 +190,11 @@ class TerminalManager { let frame = focusedWindow.frame Self.lastCascadePoint = NSPoint(x: frame.minX, y: frame.maxY) } + + // I don't think we strictly have to do this but if a window is + // closed I want to make sure that the app state is invalided so + // we don't reopen closed windows. + NSApplication.shared.invalidateRestorableState() } /// Close all windows, asking for confirmation if necessary.