diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index 47f5e542f..0eaf31305 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -374,6 +374,10 @@ extension Ghostty { } deinit { + // Whenever the surface is removed, we need to note that our restorable + // state is invalid to prevent the surface from being restored. + invalidateRestorableState() + trackingAreas.forEach { removeTrackingArea($0) } // mouseExited is not called by AppKit one last time when the view