Skip to content

Add New Tab Submenu to System Menu#20034

Open
etbala wants to merge 4 commits intomicrosoft:mainfrom
etbala:new-tab-menu-item
Open

Add New Tab Submenu to System Menu#20034
etbala wants to merge 4 commits intomicrosoft:mainfrom
etbala:new-tab-menu-item

Conversation

@etbala
Copy link
Copy Markdown
Contributor

@etbala etbala commented Mar 29, 2026

Summary

Implements #19538.

Adds a new tab submenu to the system menu that shows the different profiles available when creating a new tab normally.

Example:
image

Validation Steps Performed

  • Built + deployed locally.
  • Manually verified:
    • New Tab submenu shows active profiles (and (default) is visible on default profile)
    • When editing profiles (adding, removing, changing default, etc), the saved changes are reflected in the submenu

I was unsure if I should be adding any tests here, so I haven't done that (but I can if necessary).

@github-actions

This comment has been minimized.

Comment on lines +1142 to +1159
auto callback = winrt::delegate<void()>([weakThis = weak_from_this(), name = winrt::hstring{ profileName }]() {
if (auto strongThis = weakThis.lock())
{
if (strongThis->_windowLogic)
{
const std::array<winrt::hstring, 4> args{
winrt::hstring{ L"wt.exe" },
winrt::hstring{ L"new-tab" },
winrt::hstring{ L"--profile" },
name,
};
winrt::TerminalApp::CommandlineArgs cmdArgs;
cmdArgs.Commandline(args);
strongThis->_windowLogic.ExecuteCommandline(std::move(cmdArgs));
}
}
});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmmm. I'm not the biggest fan of how disconnected this is with the rest of the application. I think we should move away from using stringly-typed things like commandline argument parsing for internal operations, rather than towards more of it.

I think we'd need to give TerminalPage some control over the system menu contents for the window it's hosted in and allow it to drive the Action engine using callbacks, rather than having the hosting process do it.

(Technically, TerminalPage can be hosted in places other than WindowsTerminal.exe; it is not seen in practice however.)

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Mar 30, 2026
@DHowett
Copy link
Copy Markdown
Member

DHowett commented Mar 30, 2026

(otherwise, this is very cool and aiming in the right direction!)

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 4, 2026
@etbala
Copy link
Copy Markdown
Contributor Author

etbala commented Apr 4, 2026

Moved building the list of profiles to the TerminalPage (and took advantage of the Action engine in the process).

@etbala etbala requested a review from DHowett April 7, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants