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

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

Original Pull Request: https://github.com/microsoft/terminal/pull/10997

State: closed
Merged: Yes


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.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/10997 **State:** closed **Merged:** Yes --- 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.
claunia added the pull-request label 2026-01-31 09:27:57 +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#28353