[PR #18898] Persist window layout every few minutes #31635

Open
opened 2026-01-31 09:48:32 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/18898

State: closed
Merged: Yes


If persistedWindowLayout is enabled, we now persist the window layout every few minutes (excluding the text buffer).

This was done by adding a SafeDispatcherTimer to the WindowEmperor that calls PersistState() every 5 minutes. For BuildStartupKind, I split up Persist into PersistAll and PersistLayout. This way, we go through all the same code flow that Persist had except for specifically serializing the buffer.

Validation Steps Performed

(with the timer set to 3 seconds) create a window layout and ensure the layout is restored after forcefully stopping Terminal (aka simulating a "crash")

Closes #18838

**Original Pull Request:** https://github.com/microsoft/terminal/pull/18898 **State:** closed **Merged:** Yes --- If `persistedWindowLayout` is enabled, we now persist the window layout every few minutes (excluding the text buffer). This was done by adding a `SafeDispatcherTimer` to the `WindowEmperor` that calls `PersistState()` every 5 minutes. For `BuildStartupKind`, I split up `Persist` into `PersistAll` and `PersistLayout`. This way, we go through all the same code flow that `Persist` had except for specifically serializing the buffer. ## Validation Steps Performed ✅ (with the timer set to 3 seconds) create a window layout and ensure the layout is restored after forcefully stopping Terminal (aka simulating a "crash") Closes #18838
claunia added the pull-request label 2026-01-31 09:48:32 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31635