[PR #8771] Implement ApplicationState to store cross-session data #27284

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

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

State: closed
Merged: No


This pull request introduces TSM::ApplicationState. The application
state, as documented in #7972 for #8324, stores bits of information for
use across other Terminal sessions.

As implemented, application state is read from disk once on load and
committed back to disk at explicit application request. This requires
that anybody who writes to state enqueue it for commit after they do so.

Anyone consuming state can request that it be reloaded (to pull in
changes from disk) or reset (to delete the state on disk). I don't love
the ergonomics of this implementation, because somebody who is not using
GetForCurrentApp will call Reload, and if they continue using the same
object they will realize it was a huge trick, and nothing has been
reloaded
. Fortunately, there is no public constructor with which
somebody could get a non-ForCurrentApp state.

I've pulled out some shared implementation details from
CascadiaSettingsSerialization to make this a little easier.

Closes #7972

**Original Pull Request:** https://github.com/microsoft/terminal/pull/8771 **State:** closed **Merged:** No --- This pull request introduces TSM::ApplicationState. The application state, as documented in #7972 for #8324, stores bits of information for use across other Terminal sessions. As implemented, application state is read from disk once on load and committed back to disk _at explicit application request_. This requires that anybody who writes to state enqueue it for commit after they do so. Anyone consuming state can request that it be reloaded (to pull in changes from disk) or reset (to delete the state on disk). I don't love the ergonomics of this implementation, because somebody who is not using GetForCurrentApp will call `Reload`, and if they continue using the same object they will realize _it was a huge trick, and nothing has been reloaded_. Fortunately, there is no public constructor with which somebody _could_ get a non-ForCurrentApp state. I've pulled out some shared implementation details from CascadiaSettingsSerialization to make this a little easier. Closes #7972
claunia added the pull-request label 2026-01-31 09:21:05 +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#27284