[PR #2803] [MERGED] Add a schema reference to the userDefaults and patch one into user data #25079

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/2803
Author: @DHowett-MSFT
Created: 9/18/2019
Status: Merged
Merged: 9/19/2019
Merged by: @DHowett-MSFT

Base: masterHead: dev/duhowett/schematize


📝 Commits (2)

  • c20fe90 Add a schema reference to the userDefaults and patch one into existing files
  • 202b1c1 Only add the , if there's another object in there.

📊 Changes

3 files changed (+47 additions, -0 deletions)

View changed files

📝 src/cascadia/TerminalApp/CascadiaSettings.h (+1 -0)
📝 src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp (+44 -0)
📝 src/cascadia/TerminalApp/userDefaults.json (+2 -0)

📄 Description

Summary of the Pull Request

This pull request both adds a schema to the default JSON file written out for the user and adds code to patch a $schema into existing user settings.

References

#2704

PR Checklist

  • Tests added/passed/updated
  • I've discussed this with core contributors already.

Detailed Description of the Pull Request / Additional comments

We have to re-parse the settings string after every patch, because there's a chance the object offsets have moved around on us. Alternatively, we could always patch from the bottom up. That approach seems more fragile, even if it's technically faster.

Validation Steps Performed

The tests probably fail, but I tried it locally against my settings file :P


🔄 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/2803 **Author:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Created:** 9/18/2019 **Status:** ✅ Merged **Merged:** 9/19/2019 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `dev/duhowett/schematize` --- ### 📝 Commits (2) - [`c20fe90`](https://github.com/microsoft/terminal/commit/c20fe908cc027fbe42241edcf18b7d6a4950aaaa) Add a schema reference to the userDefaults and patch one into existing files - [`202b1c1`](https://github.com/microsoft/terminal/commit/202b1c155dd762f01a5e4ab65074e3b9081ef3a9) Only add the , if there's another object in there. ### 📊 Changes **3 files changed** (+47 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/CascadiaSettings.h` (+1 -0) 📝 `src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp` (+44 -0) 📝 `src/cascadia/TerminalApp/userDefaults.json` (+2 -0) </details> ### 📄 Description ## Summary of the Pull Request This pull request both adds a schema to the default JSON file written out for the user and adds code to patch a `$schema` into existing user settings. ## References #2704 ## PR Checklist * [ ] Tests added/passed/updated * [ ] I've discussed this with core contributors already. ## Detailed Description of the Pull Request / Additional comments We have to re-parse the settings string after every patch, because there's a chance the object offsets have moved around on us. Alternatively, we could always patch from the bottom up. That approach seems more fragile, even if it's technically faster. ## Validation Steps Performed The tests probably fail, but I tried it locally against my settings file :P --- <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:07:10 +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#25079