[PR #11007] [MERGED] Allow generated profiles to be deleted #28354

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11007
Author: @lhecker
Created: 8/22/2021
Status: ✅ Merged
Merged: 8/23/2021
Merged by: @undefined

Base: main ← Head: dev/lhecker/delete-generated-profiles


📝 Commits (2)

  • 8cc552c Allow generated profiles to be deleted
  • 4f16fa1 Address Dustin's comments

📊 Changes

14 files changed (+167 additions, -160 deletions)

View changed files

📝 src/cascadia/TerminalSettingsEditor/Launch.cpp (+21 -0)
📝 src/cascadia/TerminalSettingsEditor/Launch.h (+1 -0)
📝 src/cascadia/TerminalSettingsEditor/Launch.idl (+3 -0)
📝 src/cascadia/TerminalSettingsEditor/Launch.xaml (+1 -1)
📝 src/cascadia/TerminalSettingsEditor/MainPage.cpp (+8 -3)
📝 src/cascadia/TerminalSettingsEditor/Profiles.cpp (+1 -39)
📝 src/cascadia/TerminalSettingsEditor/Profiles.xaml (+70 -74)
📝 src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw (+0 -8)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp (+42 -27)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettings.h (+2 -0)
📝 src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp (+14 -8)
📝 src/cascadia/TerminalSettingsModel/Profile.cpp (+1 -0)
📝 src/cascadia/TerminalSettingsModel/Profile.h (+1 -0)
📝 src/cascadia/TerminalSettingsModel/Profile.idl (+2 -0)

📄 Description

Re-enables the delete button for generated profiles in the settings UI.
Additionally fixes "Startup Profiles" to only list active profiles.

Profiles are considered deleted if they're absent from settings.json, but their
GUID has been encountered before. Or in other words, from a user's perspective:
Generated profiles are added to the settings.json automatically only once.
Thus if the user chooses to delete the profile (e.g. using the delete button)
they aren't re-added automatically and thus appear to have been deleted.

Meanwhile those generated profiles are actually only marked as "hidden"
as well as "deleted", but still exist in internal profile lists.
The "hidden" attribute hides them from all existing menus. The "deleted" one
hides them from the settings UI and prevents them from being written to disk.

It would've been preferrable of course to just not generate and
add deleted profile to internal profile lists in the first place.
But this would've required far more wide-reaching changes.
The settings UI for instance requires a list of all profiles in order to
allow a user to re-create previously deleted profiles. Such an approach was
attempted but discarded because of it's current complexity overhead.

References

PR Checklist

Validation Steps Performed

  • "Startup Profiles" doesn't list deleted profiles ✔️
  • Manually removing an item from settings.json removes the profile ✔️
  • Removing cmd.exe and saving doesn't create empty objects (#10960) ✔️
  • "Add a new profile" lists deleted profiles ✔️
  • "Duplicate" recreates previously deleted profiles ✔️
  • Profiles are always created with GUIDs ✔️

🔄 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/11007 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 8/22/2021 **Status:** ✅ Merged **Merged:** 8/23/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/delete-generated-profiles` --- ### 📝 Commits (2) - [`8cc552c`](https://github.com/microsoft/terminal/commit/8cc552c4a967b976e91aa4e1ef8e0bacdc205561) Allow generated profiles to be deleted - [`4f16fa1`](https://github.com/microsoft/terminal/commit/4f16fa1aa267646efb41f0ec8e31035cc19431f8) Address Dustin's comments ### 📊 Changes **14 files changed** (+167 additions, -160 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalSettingsEditor/Launch.cpp` (+21 -0) 📝 `src/cascadia/TerminalSettingsEditor/Launch.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsEditor/Launch.idl` (+3 -0) 📝 `src/cascadia/TerminalSettingsEditor/Launch.xaml` (+1 -1) 📝 `src/cascadia/TerminalSettingsEditor/MainPage.cpp` (+8 -3) 📝 `src/cascadia/TerminalSettingsEditor/Profiles.cpp` (+1 -39) 📝 `src/cascadia/TerminalSettingsEditor/Profiles.xaml` (+70 -74) 📝 `src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw` (+0 -8) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp` (+42 -27) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettings.h` (+2 -0) 📝 `src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp` (+14 -8) 📝 `src/cascadia/TerminalSettingsModel/Profile.cpp` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/Profile.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/Profile.idl` (+2 -0) </details> ### 📄 Description Re-enables the delete button for generated profiles in the settings UI. Additionally fixes "Startup Profiles" to only list active profiles. Profiles are considered deleted if they're absent from settings.json, but their GUID has been encountered before. Or in other words, from a user's perspective: Generated profiles are added to the settings.json automatically only once. Thus if the user chooses to delete the profile (e.g. using the delete button) they aren't re-added automatically and thus appear to have been deleted. Meanwhile those generated profiles are actually only marked as "hidden" as well as "deleted", but still exist in internal profile lists. The "hidden" attribute hides them from all existing menus. The "deleted" one hides them from the settings UI and prevents them from being written to disk. It would've been preferrable of course to just not generate and add deleted profile to internal profile lists in the first place. But this would've required far more wide-reaching changes. The settings UI for instance requires a list of _all_ profiles in order to allow a user to re-create previously deleted profiles. Such an approach was attempted but discarded because of it's current complexity overhead. ## References * Part of #9997 * A sequel to 5d36e5d ## PR Checklist * [x] Closes #10960 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * "Startup Profiles" doesn't list deleted profiles ✔️ * Manually removing an item from settings.json removes the profile ✔️ * Removing cmd.exe and saving doesn't create empty objects (#10960) ✔️ * "Add a new profile" lists deleted profiles ✔️ * "Duplicate" recreates previously deleted profiles ✔️ * Profiles are always created with GUIDs ✔️ --- <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:58 +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#28354