[PR #10997] [MERGED] Only iterate panes one time when updating settings #28350

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10997
Author: @DHowett
Created: 8/20/2021
Status: ✅ Merged
Merged: 8/23/2021
Merged by: @undefined

Base: main ← Head: dev/duhowett/fix-profile-reload-iteration


📝 Commits (4)

  • fe9c458 Only iterate panes one time when updating settings
  • dc9cc19 PR feedback
  • 82aef2f PR feedback
  • 3af12d2 PR feedbacc III: feedbacc harder

📊 Changes

5 files changed (+76 additions, -65 deletions)

View changed files

📝 src/cascadia/TerminalApp/Pane.cpp (+17 -33)
📝 src/cascadia/TerminalApp/Pane.h (+8 -0)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+44 -24)
📝 src/cascadia/TerminalApp/TerminalTab.cpp (+4 -7)
📝 src/cascadia/TerminalApp/TerminalTab.h (+3 -1)

📄 Description

The original code for settings reload iterated the entire tree of panes
for every profile in the new settings (O(mn)) and constructed a
TerminalSettings object for every profile even if it later went unused.

This implementation:

  1. Collects all new profiles keyed by guid
    1.a. Adds the "defaults" profile to the map
  2. Iterates every pane, just once, and updates its profile if it shows
    up in the list by GUID.

I've merged all of the per-tab code into a single loop.

Because of 1.a., this code can now update panes that are hosting the
"base" profile.


🔄 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/10997 **Author:** [@DHowett](https://github.com/DHowett) **Created:** 8/20/2021 **Status:** ✅ Merged **Merged:** 8/23/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/duhowett/fix-profile-reload-iteration` --- ### 📝 Commits (4) - [`fe9c458`](https://github.com/microsoft/terminal/commit/fe9c4588b77e08d282510d6c9bd13085e810ba17) Only iterate panes one time when updating settings - [`dc9cc19`](https://github.com/microsoft/terminal/commit/dc9cc1913b4bfb9b76006e0d2933da59453225f7) PR feedback - [`82aef2f`](https://github.com/microsoft/terminal/commit/82aef2f3fd562102328136cdb0463b21abc65f4e) PR feedback - [`3af12d2`](https://github.com/microsoft/terminal/commit/3af12d2b45f44e795aa316f73fc2f3bf48a89ec2) PR feedbacc III: feedbacc harder ### 📊 Changes **5 files changed** (+76 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/Pane.cpp` (+17 -33) 📝 `src/cascadia/TerminalApp/Pane.h` (+8 -0) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+44 -24) 📝 `src/cascadia/TerminalApp/TerminalTab.cpp` (+4 -7) 📝 `src/cascadia/TerminalApp/TerminalTab.h` (+3 -1) </details> ### 📄 Description The original code for settings reload iterated the entire tree of panes for every profile in the new settings (O(mn)) and constructed a TerminalSettings object for every profile even if it later went unused. This implementation: 1. Collects all new profiles keyed by guid 1.a. Adds the "defaults" profile to the map 2. Iterates every pane, just once, and updates its profile if it shows up in the list by GUID. I've merged all of the per-tab code into a single loop. Because of 1.a., this code can now update panes that are hosting the "base" profile. --- <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:56 +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#28350