Replace TerminalSettings runtimeclasses with interfaces only #1196

Open
opened 2026-01-30 22:18:50 +00:00 by claunia · 0 comments
Owner

Originally created by @DHowett-MSFT on GitHub (May 17, 2019).

Originally assigned to: @carlos-zamora on GitHub.

TerminalSettings.dll exists because it is difficult to coerce the C++/WinRT build infrastructure to produce a type library and a set of headers without either statically linking (which rolls up the generated types into the consuming project) or dynamically linking (which forces us to put a DLL on disk).

I posit that the ideal representation of settings is the ICoreSettings and IControlSettings interfaces only. No classes need to be implemented in TerminalSettings.dll, because all they'd do is ferry data back and forth.

By dropping the classes and switching to the interfaces, we can remove the setters from the interfaces, and remove the runtime classes completely. Cascadia (or TerminalApp::<something>) can implement ICoreSettings and IControlSettings as views over existing profile data.

This will reduce both the number of runtime hops required for loading and saving settings and the number of code authoring hops required for adding new settings.

Approach

  • #7139: Introduce/Move TerminalApp bridge
    • Move TerminalSettings::TerminalSettings to TerminalApp::TerminalSettings
  • #7140: Move TerminalSettings interfaces
    • Move TerminalSettings::ICoreSettings to TerminalControl project
    • Move TerminalSettings::IControlSettings to TerminalControl project
  • #7141: Transform TerminalApp settings objects into WinRT objects
    • Profile
    • ColorScheme
    • GlobalSettings
    • Keybindings (this may be moved out to be its own PR)
  • Move the new WinRT settings objects into TerminalSettings project
    • I'll close the scenario when this is complete
Originally created by @DHowett-MSFT on GitHub (May 17, 2019). Originally assigned to: @carlos-zamora on GitHub. **TerminalSettings.dll** exists because it is difficult to coerce the C++/WinRT build infrastructure to produce a _type library_ and a set of headers without either statically linking (which rolls up the generated types into the consuming project) or dynamically linking (which forces us to put a DLL on disk). I posit that the ideal representation of settings is the `ICoreSettings` and `IControlSettings` interfaces _only_. No classes need to be implemented in TerminalSettings.dll, because all they'd do is ferry data back and forth. By dropping the classes and switching to the interfaces, we can remove the setters from the interfaces, and remove the runtime classes completely. Cascadia (or `TerminalApp::<something>`) can implement `ICoreSettings` and `IControlSettings` as views over existing profile data. This will reduce both the number of runtime hops required for loading and saving settings and the number of code authoring hops required for adding new settings. ## Approach - [x] #7139: Introduce/Move TerminalApp bridge - Move `TerminalSettings::TerminalSettings` to `TerminalApp::TerminalSettings` - [x] #7140: Move `TerminalSettings` interfaces - Move `TerminalSettings::ICoreSettings` to TerminalControl project - Move `TerminalSettings::IControlSettings` to TerminalControl project - [ ] #7141: Transform TerminalApp settings objects into WinRT objects - Profile - ColorScheme - GlobalSettings - Keybindings (this may be moved out to be its own PR) - [ ] Move the new WinRT settings objects into TerminalSettings project - I'll close the scenario when this is complete
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1196