[PR #5706] [MERGED] Allow the default profile to be specified by name #26425

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5706
Author: @DHowett-MSFT
Created: 5/2/2020
Status: Merged
Merged: 6/1/2020
Merged by: @undefined

Base: masterHead: dev/duhowett/hax/default-profile-by-name


📝 Commits (6)

  • 29ecd30 Factor GetProfileByName out of GetProfileForArgs
  • 0f90b7e keep hacking on this: end goal = default by name
  • a06b371 morhax
  • 44f028b Allow the default profile to be specified by name
  • ec9eeda Merge remote-tracking branch 'origin/master' into dev/duhowett/hax/default-profile-by-name
  • 9aa292c don't beef it when we telemate

📊 Changes

8 files changed (+174 additions, -115 deletions)

View changed files

📝 doc/cascadia/profiles.schema.json (+2 -2)
📝 src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp (+51 -20)
📝 src/cascadia/TerminalApp/CascadiaSettings.cpp (+71 -84)
📝 src/cascadia/TerminalApp/CascadiaSettings.h (+3 -2)
📝 src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp (+4 -3)
📝 src/cascadia/TerminalApp/GlobalAppSettings.cpp (+11 -3)
📝 src/cascadia/TerminalApp/GlobalAppSettings.h (+3 -1)
📝 src/types/inc/utils.hpp (+29 -0)

📄 Description

Summary of the Pull Request

This looks like a big diff, but there's a bunch of existing code that
just got moved around, and there's a cool new Utils template.

The tests all pass, and this passed manual validation. I tried weird
things like "making a profile named { }"
(w/ enough spaces to look like a guid), and yeah it doesn't let you
specify that one as a name, but why would you do that?!

Okay, this pull request abstracts the conversion of a profile name into
an optional profile guid out of the "New Terminal Tab Args" handler and
into a common space for all of CascadiaSettings to use.

It also cleans up the conversion of indices and names into optional
GUIDs and turns those into further helpers.

It also introduces a cool new template for running value_or multiple
times on a chain of optionals. CoalesceOptionals is a "choose first,
with fallback" for N>1 optionals.

On top of all this, I've built support for an "unparsed default GUID":
we load the user's defaultProfile as a string, and as part of settings
validation we unpack that string using the helpers outlined above.

References

Couples well with #5690.

PR Checklist

Validation Steps Performed

Added additional test collateral to make sure that this works.


🔄 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/5706 **Author:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Created:** 5/2/2020 **Status:** ✅ Merged **Merged:** 6/1/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/duhowett/hax/default-profile-by-name` --- ### 📝 Commits (6) - [`29ecd30`](https://github.com/microsoft/terminal/commit/29ecd3050a1c07961eaea9cb06bd890d5efd4b4b) Factor GetProfileByName out of GetProfileForArgs - [`0f90b7e`](https://github.com/microsoft/terminal/commit/0f90b7e0c3b76ec4c3304c4ccbec148874f2acfe) keep hacking on this: end goal = default by name - [`a06b371`](https://github.com/microsoft/terminal/commit/a06b37129c5bcf336258ce3c6a57ba8396e7cc9e) morhax - [`44f028b`](https://github.com/microsoft/terminal/commit/44f028b53ffa01f3c4d0523a0b37d60d13353664) Allow the default profile to be specified by name - [`ec9eeda`](https://github.com/microsoft/terminal/commit/ec9eeda61f4f3fdeb49fddf08b91a50178af7649) Merge remote-tracking branch 'origin/master' into dev/duhowett/hax/default-profile-by-name - [`9aa292c`](https://github.com/microsoft/terminal/commit/9aa292cc98b6480996a0a7d746856210ec6e90fa) don't beef it when we telemate ### 📊 Changes **8 files changed** (+174 additions, -115 deletions) <details> <summary>View changed files</summary> 📝 `doc/cascadia/profiles.schema.json` (+2 -2) 📝 `src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp` (+51 -20) 📝 `src/cascadia/TerminalApp/CascadiaSettings.cpp` (+71 -84) 📝 `src/cascadia/TerminalApp/CascadiaSettings.h` (+3 -2) 📝 `src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp` (+4 -3) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.cpp` (+11 -3) 📝 `src/cascadia/TerminalApp/GlobalAppSettings.h` (+3 -1) 📝 `src/types/inc/utils.hpp` (+29 -0) </details> ### 📄 Description ## Summary of the Pull Request This looks like a big diff, but there's a bunch of existing code that just got moved around, and there's a cool new Utils template. The tests all pass, and this passed manual validation. I tried weird things like "making a profile named `{ }`" (w/ enough spaces to look like a guid), and yeah it doesn't let you specify that one as a name, but _why would you do that?!_ Okay, this pull request abstracts the conversion of a profile name into an optional profile guid out of the "New Terminal Tab Args" handler and into a common space for all of CascadiaSettings to use. It also cleans up the conversion of indices and names into optional GUIDs and turns _those_ into further helpers. It also introduces a cool new template for running value_or multiple times on a chain of optionals. CoalesceOptionals is a "choose first, with fallback" for N>1 optionals. On top of all this, I've built support for an "unparsed default GUID": we load the user's defaultProfile as a string, and as part of settings validation we unpack that string using the helpers outlined above. ## References Couples well with #5690. ## PR Checklist * [x] Incidentally fixes #2876 * [x] Core Contributor * [x] Tests added/passed * [x] Requires documentation to be updated (done) * [x] I've discussed this with core contributors already ## Validation Steps Performed Added additional test collateral to make sure that this works. --- <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:16:00 +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#26425