[PR #12907] [MERGED] Initialize Terminal Preview settings from Terminal settings #29291

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12907
Author: @huiyooumich
Created: 4/14/2022
Status: Merged
Merged: 6/10/2022
Merged by: @undefined

Base: mainHead: dev/huiyooumich/6855-intialize-preview-settings


📝 Commits (4)

  • 0694a4e Added initial migrate of Release settings to Preview
  • 022cd58 Fixed style check
  • cd7cf1e Merge branch 'main' into dev/huiyooumich/6855-intialize-preview-settings
  • e75bc55 Update src/cascadia/TerminalSettingsModel/FileUtils.cpp

📊 Changes

4 files changed (+68 additions, -4 deletions)

View changed files

📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.h (+1 -0)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp (+39 -4)
📝 src/cascadia/TerminalSettingsModel/FileUtils.cpp (+27 -0)
📝 src/cascadia/TerminalSettingsModel/FileUtils.h (+1 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/12907 **Author:** [@huiyooumich](https://github.com/huiyooumich) **Created:** 4/14/2022 **Status:** ✅ Merged **Merged:** 6/10/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/huiyooumich/6855-intialize-preview-settings` --- ### 📝 Commits (4) - [`0694a4e`](https://github.com/microsoft/terminal/commit/0694a4eccf9ae99751cd1e4c17d3aacdf177bbf0) Added initial migrate of Release settings to Preview - [`022cd58`](https://github.com/microsoft/terminal/commit/022cd585cec459708da7f6b1c607e8acb9559cc2) Fixed style check - [`cd7cf1e`](https://github.com/microsoft/terminal/commit/cd7cf1e947eb1a9981a474891f717d7a75d83e56) Merge branch 'main' into dev/huiyooumich/6855-intialize-preview-settings - [`e75bc55`](https://github.com/microsoft/terminal/commit/e75bc55f1d0445455c64f19e0144474804d449cf) Update src/cascadia/TerminalSettingsModel/FileUtils.cpp ### 📊 Changes **4 files changed** (+68 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp` (+39 -4) 📝 `src/cascadia/TerminalSettingsModel/FileUtils.cpp` (+27 -0) 📝 `src/cascadia/TerminalSettingsModel/FileUtils.h` (+1 -0) </details> ### 📄 Description 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> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:34:03 +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#29291