@@ -3306,59 +3306,19 @@ namespace winrt::TerminalApp::implementation
3306
3306
3307
3307
// Refresh UI elements
3308
3308
3309
+ // Recreate the TerminalSettings cache here. We'll use that as we're
3310
+ // updating terminal panes, so that we don't have to build a _new_
3311
+ // TerminalSettings for every profile we update - we can just look them
3312
+ // up the previous ones we built.
3309
3313
_terminalSettingsCache = TerminalApp::TerminalSettingsCache{ _settings, *_bindings };
3310
3314
3311
- // // Mapping by GUID isn't _excellent_ because the defaults profile doesn't have a stable GUID; however,
3312
- // // when we stabilize its guid this will become fully safe.
3313
- // std::unordered_map<winrt::guid, std::pair<Profile, TerminalSettingsCreateResult>> profileGuidSettingsMap;
3314
- // const auto profileDefaults{ _settings.ProfileDefaults() };
3315
- // const auto allProfiles{ _settings.AllProfiles() };
3316
-
3317
- // profileGuidSettingsMap.reserve(allProfiles.Size() + 1);
3318
-
3319
- // // Include the Defaults profile for consideration
3320
- // profileGuidSettingsMap.insert_or_assign(profileDefaults.Guid(), std::pair{ profileDefaults, nullptr });
3321
- // for (const auto& newProfile : allProfiles)
3322
- // {
3323
- // // Avoid creating a TerminalSettings right now. They're not totally cheap, and we suspect that users with many
3324
- // // panes may not be using all of their profiles at the same time. Lazy evaluation is king!
3325
- // profileGuidSettingsMap.insert_or_assign(newProfile.Guid(), std::pair{ newProfile, nullptr });
3326
- // }
3327
-
3328
3315
for (const auto & tab : _tabs)
3329
3316
{
3330
3317
if (auto terminalTab{ _GetTerminalTabImpl (tab) })
3331
3318
{
3332
3319
// Let the tab know that there are new settings. It's up to each content to decide what to do with them.
3333
3320
terminalTab->UpdateSettings (_settings, _terminalSettingsCache);
3334
3321
3335
- // // FURTHERMORE We need to do a bit more work here for terminal
3336
- // // panes. They need to know about the profile that was used for
3337
- // // them, and about the focused/unfocused settings.
3338
-
3339
- // // Manually enumerate the panes in each tab; this will let us recycle TerminalSettings
3340
- // // objects but only have to iterate one time.
3341
- // terminalTab->GetRootPane()->WalkTree([&](auto&& pane) {
3342
- // // If the pane isn't a terminal pane, it won't have a profile.
3343
- // if (const auto profile{ pane->GetProfile() })
3344
- // {
3345
- // const auto found{ profileGuidSettingsMap.find(profile.Guid()) };
3346
- // // GH#2455: If there are any panes with controls that had been
3347
- // // initialized with a Profile that no longer exists in our list of
3348
- // // profiles, we'll leave it unmodified. The profile doesn't exist
3349
- // // anymore, so we can't possibly update its settings.
3350
- // if (found != profileGuidSettingsMap.cend())
3351
- // {
3352
- // auto& pair{ found->second };
3353
- // if (!pair.second)
3354
- // {
3355
- // pair.second = TerminalSettings::CreateWithProfile(_settings, pair.first, *_bindings);
3356
- // }
3357
- // pane->UpdateTerminalSettings(pair.second, pair.first);
3358
- // }
3359
- // }
3360
- // });
3361
-
3362
3322
// Update the icon of the tab for the currently focused profile in that tab.
3363
3323
// Only do this for TerminalTabs. Other types of tabs won't have multiple panes
3364
3324
// and profiles so the Title and Icon will be set once and only once on init.
0 commit comments