[PR #5199] [MERGED] rename profiles.json to settings.json, clean up the defaults #26167

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5199
Author: @DHowett-MSFT
Created: 3/31/2020
Status: Merged
Merged: 4/1/2020
Merged by: @undefined

Base: masterHead: dev/duhowett/legacy_ii_legacy_harder


📝 Commits (6)

  • 961793f Settings: Stop resurrecting dead roaming profiles
  • 6394820 Settings: move profiles.json to settings.json
  • 4719fcb Settings: kill stray newlines in template files
  • 947054c Settings: sync universal with main
  • b72d411 Settings: categorize key bindings
  • 46ac179 Update all user-docs

📊 Changes

9 files changed (+144 additions, -126 deletions)

View changed files

📝 doc/user-docs/ThirdPartyToolProfiles.md (+1 -1)
📝 doc/user-docs/UsingJsonSettings.md (+12 -12)
📝 doc/user-docs/index.md (+2 -2)
📝 src/cascadia/TerminalApp/AppLogic.cpp (+1 -1)
📝 src/cascadia/TerminalApp/CascadiaSettings.h (+2 -2)
📝 src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp (+25 -30)
📝 src/cascadia/TerminalApp/defaults-universal.json (+61 -49)
📝 src/cascadia/TerminalApp/defaults.json (+39 -28)
📝 tools/GenerateHeaderForJson.ps1 (+1 -1)

📄 Description

This pull request migrates profiles.json to settings.json and removes the legacy roaming AppData settings migrator.

It also:

  • separates the key bindings in defaults.json into logical groups
  • syncs the universal terminal defaults with the primary defaults
  • removes some stray newlines that ended up at the beginning of settings.json and defaults.json

Fixes #5186.
Fixes #3291.

categorize key bindings

sync universal with main

kill stray newlines in template files

move profiles.json to settings.json

This commit also changes Get*Settings from returning a string to
returning a std::filesystem::path. We gain in expressiveness without a
loss in clarity (since path still supports .c_str()).

NOTE: I tried to do an atomic rename with the handle open, but it didn't
work for reparse points (it moves the destination of a symbolic link
out into the settings folder directly.)

(snip for atomic rename code)

auto path{ pathToSettingsFile.wstring() };
auto renameBufferSize{ sizeof(FILE_RENAME_INFO) + (path.size() * sizeof(wchar_t)) };
auto renameBuffer{ std::make_unique<std::byte[]>(renameBufferSize) };
auto renameInfo{ reinterpret_cast<FILE_RENAME_INFO*>(renameBuffer.get()) };
renameInfo->Flags = FILE_RENAME_FLAG_REPLACE_IF_EXISTS | FILE_RENAME_FLAG_POSIX_SEMANTICS;
renameInfo->RootDirectory = nullptr;
renameInfo->FileNameLength = gsl::narrow_cast<DWORD>(path.size());
std::copy(path.cbegin(), path.cend(), std::begin(renameInfo->FileName));

THROW_IF_WIN32_BOOL_FALSE(SetFileInformationByHandle(hLegacyFile.get(),
                          FileRenameInfo,
                          renameBuffer.get(),
                          gsl::narrow_cast<DWORD>(renameBufferSize)));

(end snip)

Stop resurrecting dead roaming profiles


🔄 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/5199 **Author:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Created:** 3/31/2020 **Status:** ✅ Merged **Merged:** 4/1/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/duhowett/legacy_ii_legacy_harder` --- ### 📝 Commits (6) - [`961793f`](https://github.com/microsoft/terminal/commit/961793f58cedc7b8e736301acd66a1351caca7ab) Settings: Stop resurrecting dead roaming profiles - [`6394820`](https://github.com/microsoft/terminal/commit/6394820e85be6be66bc08250705565c3f30c0c40) Settings: move profiles.json to settings.json - [`4719fcb`](https://github.com/microsoft/terminal/commit/4719fcbdd48e5e25662c5dd466fd103a18541a1b) Settings: kill stray newlines in template files - [`947054c`](https://github.com/microsoft/terminal/commit/947054c2204c72dd771953cf287ea80c250ab24e) Settings: sync universal with main - [`b72d411`](https://github.com/microsoft/terminal/commit/b72d41111a57e1dc70ff1af330c7a9a0a00d9b18) Settings: categorize key bindings - [`46ac179`](https://github.com/microsoft/terminal/commit/46ac1798f71f198ca5088b58d2b12ef1bfa9d8c4) Update all user-docs ### 📊 Changes **9 files changed** (+144 additions, -126 deletions) <details> <summary>View changed files</summary> 📝 `doc/user-docs/ThirdPartyToolProfiles.md` (+1 -1) 📝 `doc/user-docs/UsingJsonSettings.md` (+12 -12) 📝 `doc/user-docs/index.md` (+2 -2) 📝 `src/cascadia/TerminalApp/AppLogic.cpp` (+1 -1) 📝 `src/cascadia/TerminalApp/CascadiaSettings.h` (+2 -2) 📝 `src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp` (+25 -30) 📝 `src/cascadia/TerminalApp/defaults-universal.json` (+61 -49) 📝 `src/cascadia/TerminalApp/defaults.json` (+39 -28) 📝 `tools/GenerateHeaderForJson.ps1` (+1 -1) </details> ### 📄 Description This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json Fixes #5186. Fixes #3291. ### categorize key bindings ### sync universal with main ### kill stray newlines in template files ### move profiles.json to settings.json This commit also changes Get*Settings from returning a string to returning a std::filesystem::path. We gain in expressiveness without a loss in clarity (since path still supports .c_str()). NOTE: I tried to do an atomic rename with the handle open, but it didn't work for reparse points (it moves the destination of a symbolic link out into the settings folder directly.) (snip for atomic rename code) ```c++ auto path{ pathToSettingsFile.wstring() }; auto renameBufferSize{ sizeof(FILE_RENAME_INFO) + (path.size() * sizeof(wchar_t)) }; auto renameBuffer{ std::make_unique<std::byte[]>(renameBufferSize) }; auto renameInfo{ reinterpret_cast<FILE_RENAME_INFO*>(renameBuffer.get()) }; renameInfo->Flags = FILE_RENAME_FLAG_REPLACE_IF_EXISTS | FILE_RENAME_FLAG_POSIX_SEMANTICS; renameInfo->RootDirectory = nullptr; renameInfo->FileNameLength = gsl::narrow_cast<DWORD>(path.size()); std::copy(path.cbegin(), path.cend(), std::begin(renameInfo->FileName)); THROW_IF_WIN32_BOOL_FALSE(SetFileInformationByHandle(hLegacyFile.get(), FileRenameInfo, renameBuffer.get(), gsl::narrow_cast<DWORD>(renameBufferSize))); ``` (end snip) ### Stop resurrecting dead roaming profiles --- <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:14:22 +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#26167