[PR #15481] Switch context menu generation to use a flags enum of actions #30648

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

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

State: open
Merged: No


Calling a hundred bespoke WinRT methods to determine what context menu items to show is not scalable!

In the future, we can add...

MenuAction::Copy (applicable when there is a selection)
MenuAction::Paste (applicable when the control is not read-only)
MenuAction::CopyLink (applicable when there is a link!)

I also moved ownership of knowing where the menu was opened to TermControl.
It could go down to Interactivity with some work.
It just felt wrong to have the Core remembering this user interaction state.

I also fixed some trivial resource duplication.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/15481 **State:** open **Merged:** No --- Calling a hundred bespoke WinRT methods to determine what context menu items to show is not scalable! In the future, we can add... ``` MenuAction::Copy (applicable when there is a selection) MenuAction::Paste (applicable when the control is not read-only) MenuAction::CopyLink (applicable when there is a link!) ``` I also moved ownership of knowing where the menu was opened to TermControl. It could go down to Interactivity with some work. It just felt wrong to have the Core remembering this user interaction state. I _also_ fixed some trivial resource duplication.
claunia added the pull-request label 2026-01-31 09:42: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#30648