[PR #19341] Add firstWindowPreference value for layout only #31805

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

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

State: closed
Merged: Yes


Summary of the Pull Request

Updates the "firstWindowPreference" global setting to take 3 values: "defaultProfile", "persistedLayout", and "persistedLayoutAndContent".

The legacy "persistedWindowLayout" is being interpreted as "persistedLayoutAndContent".

The tricky part here is that we need to maintain support for the legacy value as persisting the layout and content, even though the value's name suggests that it should just support the layout and no content. To get around this, I added "persistedLayout" and "persistedLayoutAndContent".

The enum map is manually constructed for FirstWindowPreference to exclude the deprecated value. This prevents the legacy value from leaking into the settings UI.

Functionally, the change to serialize the contents is simple. WindowEmperor::_persistState()'s second parameter is used to serialize the buffer. Rather than having it set to true, we set it to GlobalSettings().FirstWindowPreference() == FirstWindowPreference::PersistedLayoutAndContent.

Validation Steps Performed

"persistedWindowLayout" is changed to "persistedLayoutAndContent"

Closes #18757

**Original Pull Request:** https://github.com/microsoft/terminal/pull/19341 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Updates the "firstWindowPreference" global setting to take 3 values: "defaultProfile", "persistedLayout", and "persistedLayoutAndContent". The legacy "persistedWindowLayout" is being interpreted as "persistedLayoutAndContent". The tricky part here is that we need to maintain support for the legacy value as persisting the layout and content, even though the value's name suggests that it should just support the layout and no content. To get around this, I added "persistedLayout" and "persistedLayoutAndContent". The enum map is manually constructed for `FirstWindowPreference` to exclude the deprecated value. This prevents the legacy value from leaking into the settings UI. Functionally, the change to serialize the contents is simple. `WindowEmperor::_persistState()`'s second parameter is used to serialize the buffer. Rather than having it set to `true`, we set it to `GlobalSettings().FirstWindowPreference() == FirstWindowPreference::PersistedLayoutAndContent`. ## Validation Steps Performed ✅ "persistedWindowLayout" is changed to "persistedLayoutAndContent" Closes #18757
claunia added the pull-request label 2026-01-31 09:49:40 +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#31805