[PR #10982] [MERGED] Rely more on profile objects and less on GUIDs #28336

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10982
Author: @DHowett
Created: 8/18/2021
Status: Merged
Merged: 8/23/2021
Merged by: @DHowett

Base: mainHead: dev/duhowett/no-profile-guid


📝 Commits (3)

  • 92c43c8 Reduce the number of GUID round trips when looking up profiles.
  • 4cd3443 PR Feedback
  • 8f57014 Fix the TryDuplicateBadThing tests

📊 Changes

16 files changed (+142 additions, -183 deletions)

View changed files

📝 src/cascadia/LocalTests_SettingsModel/TerminalSettingsTests.cpp (+34 -34)
📝 src/cascadia/LocalTests_TerminalApp/TabTests.cpp (+3 -3)
📝 src/cascadia/TerminalApp/AppActionHandlers.cpp (+2 -3)
📝 src/cascadia/TerminalApp/Pane.cpp (+27 -26)
📝 src/cascadia/TerminalApp/Pane.h (+5 -5)
📝 src/cascadia/TerminalApp/TabManagement.cpp (+22 -40)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+26 -23)
📝 src/cascadia/TerminalApp/TerminalPage.h (+2 -2)
📝 src/cascadia/TerminalApp/TerminalTab.cpp (+4 -4)
📝 src/cascadia/TerminalApp/TerminalTab.h (+4 -4)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp (+6 -8)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.h (+3 -3)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.idl (+2 -2)
📝 src/cascadia/TerminalSettingsModel/TerminalSettings.cpp (+2 -21)
📝 src/cascadia/TerminalSettingsModel/TerminalSettings.h (+0 -4)
📝 src/cascadia/TerminalSettingsModel/TerminalSettings.idl (+0 -1)

📄 Description

Right now, we store GUIDs in panes and most of the functions for interacting
with profiles on the settings model take GUIDs and look up profiles.

This pull request changes how we store and look up profiles to prefer profile
objects. Panes store strong references to their originating profiles, which
simplifies settings lookup for CloseOnExit and the bell settings. In fact,
deleting a pane's profile no longer causes it to forget which CloseOnExit
setting applies to it. Duplicating a pane that is hosting a deleted profile
(#5047) now duplicates the profile, even though it is otherwise unreachable.

This makes the world more consistent and allows us to eventually support panes
hosting profiles that do not have GUIDs that can be looked up in the profile
list. This is a gateway to #6776 and #10669, and consolidating the profile
lookup logic will help with #10952.

PR #10588 introduced TerminalSettings::CreateWithProfile and made
...CreateWithProfileByID a thin wrapper over top it, which looked up the profile
by GUID before proceeding. It has also been removed, as its last caller is gone.

Closes #5047


🔄 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/10982 **Author:** [@DHowett](https://github.com/DHowett) **Created:** 8/18/2021 **Status:** ✅ Merged **Merged:** 8/23/2021 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `dev/duhowett/no-profile-guid` --- ### 📝 Commits (3) - [`92c43c8`](https://github.com/microsoft/terminal/commit/92c43c8c1ec41a2dec46f1042306cbca234233e7) Reduce the number of GUID round trips when looking up profiles. - [`4cd3443`](https://github.com/microsoft/terminal/commit/4cd34438994fb62aed60038fa3559e37bbbc945f) PR Feedback - [`8f57014`](https://github.com/microsoft/terminal/commit/8f570149694961e53b6e4dbb47855a1bd1e56997) Fix the TryDuplicateBadThing tests ### 📊 Changes **16 files changed** (+142 additions, -183 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/LocalTests_SettingsModel/TerminalSettingsTests.cpp` (+34 -34) 📝 `src/cascadia/LocalTests_TerminalApp/TabTests.cpp` (+3 -3) 📝 `src/cascadia/TerminalApp/AppActionHandlers.cpp` (+2 -3) 📝 `src/cascadia/TerminalApp/Pane.cpp` (+27 -26) 📝 `src/cascadia/TerminalApp/Pane.h` (+5 -5) 📝 `src/cascadia/TerminalApp/TabManagement.cpp` (+22 -40) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+26 -23) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+2 -2) 📝 `src/cascadia/TerminalApp/TerminalTab.cpp` (+4 -4) 📝 `src/cascadia/TerminalApp/TerminalTab.h` (+4 -4) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp` (+6 -8) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.h` (+3 -3) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.idl` (+2 -2) 📝 `src/cascadia/TerminalSettingsModel/TerminalSettings.cpp` (+2 -21) 📝 `src/cascadia/TerminalSettingsModel/TerminalSettings.h` (+0 -4) 📝 `src/cascadia/TerminalSettingsModel/TerminalSettings.idl` (+0 -1) </details> ### 📄 Description Right now, we store GUIDs in panes and most of the functions for interacting with profiles on the settings model take GUIDs and look up profiles. This pull request changes how we store and look up profiles to prefer profile objects. Panes store strong references to their originating profiles, which simplifies settings lookup for CloseOnExit and the bell settings. In fact, deleting a pane's profile no longer causes it to forget which CloseOnExit setting applies to it. Duplicating a pane that is hosting a deleted profile (#5047) now duplicates the profile, even though it is otherwise unreachable. This makes the world more consistent and allows us to _eventually_ support panes hosting profiles that do not have GUIDs that can be looked up in the profile list. This is a gateway to #6776 and #10669, and consolidating the profile lookup logic will help with #10952. PR #10588 introduced TerminalSettings::CreateWithProfile and made ...CreateWithProfileByID a thin wrapper over top it, which looked up the profile by GUID before proceeding. It has also been removed, as its last caller is gone. Closes #5047 --- <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:27:52 +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#28336