[PR #12907] Initialize Terminal Preview settings from Terminal settings #29296

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

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

State: closed
Merged: Yes


Windows Terminal Preview gets existing settings from Release build if
Preview settings are empty

This ensures that when settings are empty or not existent, we check if
we're currently in a preview build and if we are, we attempt to grab
settings from the Release build's setting path instead. We tested it
manually by changing settings in Release build and confirming that
changes migrated to Preview when settings are empty or not existent.
Additionally, we tested that settings.json of the running build changed.
We also ran existing TAEF testing locally and it passed.

In LoadAll() function in
src\cascadia\TerminalSettingsModel\CascadiaSettingsSerialization.cpp, we
first checked if the settings file us empty/exists via settingsString.
If it does not and we are in the Preview build, we try loading the
Release build's settings. We created modified versions of
CascadiaSettings::_settingsPath() and GetBaseSettingsPath() to get the
path for the Release build's settings. If the Release build settings do
exist and firstTimeSetup is true, we set it to settingsString so it can
be written to disk via WriteSettingsToDisk(). Note that currently we
hardcode the path of the Release build. This pull request was worked on
with @Dannihu01.

Validation Steps Performed Test1: Setting to firstTimeSetup is true

and loading settings.json from WT release when release exists -> Result:
settings.json AND GUI reflected WT release’s settings

Test2: Setting to firstTimeSetup is true and loading settings.json from
WT release when release doesn’t exist -> Result: settings.json AND GUI
reflected DEFAULT settings

Test3: (After running Test1) Setting to firstTimeSetup is false and
seeing if current settings.json matches WT release. (See if it doesn’t
change) -> Result: settings.json AND GUI reflected WT release’s settings

Closes #6855

Co-authored-by: Danniell Hu dannihu@umich.edu

**Original Pull Request:** https://github.com/microsoft/terminal/pull/12907 **State:** closed **Merged:** Yes --- Windows Terminal Preview gets existing settings from Release build if Preview settings are empty This ensures that when settings are empty or not existent, we check if we're currently in a preview build and if we are, we attempt to grab settings from the Release build's setting path instead. We tested it manually by changing settings in Release build and confirming that changes migrated to Preview when settings are empty or not existent. Additionally, we tested that settings.json of the running build changed. We also ran existing TAEF testing locally and it passed. In LoadAll() function in src\cascadia\TerminalSettingsModel\CascadiaSettingsSerialization.cpp, we first checked if the settings file us empty/exists via settingsString. If it does not and we are in the Preview build, we try loading the Release build's settings. We created modified versions of CascadiaSettings::_settingsPath() and GetBaseSettingsPath() to get the path for the Release build's settings. If the Release build settings do exist and firstTimeSetup is true, we set it to settingsString so it can be written to disk via WriteSettingsToDisk(). Note that currently we hardcode the path of the Release build. This pull request was worked on with @Dannihu01. ## Validation Steps Performed Test1: Setting to firstTimeSetup is true and loading settings.json from WT release when release exists -> Result: settings.json AND GUI reflected WT release’s settings Test2: Setting to firstTimeSetup is true and loading settings.json from WT release when release doesn’t exist -> Result: settings.json AND GUI reflected DEFAULT settings Test3: (After running Test1) Setting to firstTimeSetup is false and seeing if current settings.json matches WT release. (See if it doesn’t change) -> Result: settings.json AND GUI reflected WT release’s settings Closes #6855 Co-authored-by: Danniell Hu <dannihu@umich.edu>
claunia added the pull-request label 2026-01-31 09:34: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#29296