Conversation
This comment has been minimized.
This comment has been minimized.
| 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)); | ||
| } | ||
| } | ||
| }); | ||
|
|
There was a problem hiding this comment.
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.)
|
(otherwise, this is very cool and aiming in the right direction!) |
|
Moved building the list of profiles to the TerminalPage (and took advantage of the Action engine in the process). |
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:

Validation Steps Performed
(default)is visible on default profile)I was unsure if I should be adding any tests here, so I haven't done that (but I can if necessary).