[PR #19132] Remove WinRT composition (inheritance) from PaletteItem #31713

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

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

State: closed
Merged: Yes


Right now, we construct two objects for every palette item: the
derived type and the base type. It's unnnecessary.

This pull request replaces WinRT composition with a good old-fashioned
enum ThingType.

This also removes many of our palette items from our IDL. The only ones
that are necessary to expose via our WinRT API surface are the ones that
are used in XAML documents.

I originally removed the caching for Command.Name, but it turns out
that something calls Name roughly 17 times per command and having
the generator running that often is a serious waste of CPU.

Validation Steps

  • Tab Switcher still live-updates when it is in use
  • Command searching still works
  • Commandline mode still works
  • Suggestions control still works
**Original Pull Request:** https://github.com/microsoft/terminal/pull/19132 **State:** closed **Merged:** Yes --- Right now, we construct **two objects** for every palette item: the derived type and the base type. It's unnnecessary. This pull request replaces WinRT composition with a good old-fashioned `enum ThingType`. This also removes many of our palette items from our IDL. The only ones that are necessary to expose via our WinRT API surface are the ones that are used in XAML documents. I originally removed the caching for `Command.Name`, but it turns out that something calls `Name` roughly 17 times **per command** and having the generator running that often is a serious waste of CPU. ## Validation Steps - [x] Tab Switcher still live-updates when it is in use - [x] Command searching still works - [x] Commandline mode still works - [x] Suggestions control still works
claunia added the pull-request label 2026-01-31 09:49:05 +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#31713