Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One process to rule them all #14843

Merged
merged 126 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from 124 commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
581acd4
I definitely want all of this. But I started down a path for refactor…
zadjii-msft Jan 30, 2023
a5255ba
I don't think I want any of these
zadjii-msft Jan 30, 2023
e6220b7
Revert "I don't think I want any of these"
zadjii-msft Jan 30, 2023
936c01f
Start splitting AppLogic into AppLogic and Window logic
zadjii-msft Jan 30, 2023
439b21f
this is dangerously close to compiling
zadjii-msft Jan 30, 2023
99bc280
It doesn't crash on launch. That's something. There's no startupActio…
zadjii-msft Jan 31, 2023
2195515
it launches
zadjii-msft Jan 31, 2023
5116ca1
I think the todo's that are left, we can move on without them for now.
zadjii-msft Jan 31, 2023
ef7e2ed
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Jan 31, 2023
af14c2b
[TO PARENT] Move the page ctor call, so that it can happen after the …
zadjii-msft Jan 31, 2023
d456210
Use the single AppLogic for all windows. Remove the _app references. …
zadjii-msft Jan 31, 2023
f5b030c
it runs!
zadjii-msft Jan 31, 2023
2c4613a
wow it just... worked
zadjii-msft Feb 1, 2023
7a3e2e0
Start rewriting WindowManager to facilitate the new process model
zadjii-msft Feb 1, 2023
f655296
This does successfully get a window on the screen, which is pretty im…
zadjii-msft Feb 1, 2023
274d62d
it's working
zadjii-msft Feb 1, 2023
e623299
notes
zadjii-msft Feb 1, 2023
47336c0
[ainulindale] Clean tear down the `App` when the process exits
zadjii-msft Feb 3, 2023
9924e23
[ainulindale] "fix" hot reload
zadjii-msft Feb 3, 2023
f06e484
[ainulindale] This I'm confident fixes some of the x-thread errors, b…
zadjii-msft Feb 7, 2023
2822c36
[ainulindale] Expand commands in the AppLogic, not on each page
zadjii-msft Feb 7, 2023
2332f0c
Don't try to snap on create if we're not prepared to snap
zadjii-msft Feb 8, 2023
4e7da2e
I guess this is just dead now
zadjii-msft Feb 8, 2023
23c4d4c
Move the initialization of the showHide Throttler after we init the d…
zadjii-msft Feb 8, 2023
761bd6a
This one was dead code, 34 TODOs left
zadjii-msft Feb 8, 2023
93e9dc5
I guess we need to just hardcode these sizes. Sad, but okay.
zadjii-msft Feb 8, 2023
d5396d1
UWP is dead
zadjii-msft Feb 8, 2023
07ff418
Plumb initial load result into the window on startup
zadjii-msft Feb 8, 2023
40fdbc1
Hey this comment was TODOne, 29 TODOs left
zadjii-msft Feb 8, 2023
4db381e
not totally happy with this, but I understand why. 29 TODOs left
zadjii-msft Feb 8, 2023
64257d8
This straight up isn't even used in main anymore, 26 TODOs left
zadjii-msft Feb 8, 2023
3026922
Fix the window name not updating as it changed. Added some notes, so,…
zadjii-msft Feb 8, 2023
84e228f
Start to move window restoration into the Emperor
zadjii-msft Feb 8, 2023
dc1ae9a
Starting to move these things to the right places
zadjii-msft Feb 8, 2023
8bb8391
move more window persist code around.
zadjii-msft Feb 8, 2023
0f4c4d8
It persists, but it doesn't restore yet.
zadjii-msft Feb 8, 2023
a5a9930
Hey look I brought two windows back into existence!...
zadjii-msft Feb 8, 2023
6e6d14e
We're getting closer to loading up the previous state, but it doesn't…
zadjii-msft Feb 8, 2023
3fb8e8c
Hey this worked!
zadjii-msft Feb 8, 2023
4d5f6d2
cleanup. 18 TODOs remain
zadjii-msft Feb 8, 2023
a7379ca
It so SO works
zadjii-msft Feb 9, 2023
0b79e81
Summoning works, except for making new windows, but DANG
zadjii-msft Feb 9, 2023
950ce6c
make pane brushes a member variable, which is good enough
zadjii-msft Feb 7, 2023
055da35
Readd ShouldImmediatelyHandoffToElevated
zadjii-msft Feb 9, 2023
b0726c2
Handle Quit actions
zadjii-msft Feb 9, 2023
e214624
Re-add support for the notification icon.
zadjii-msft Feb 9, 2023
c69f0bc
Quake logic seems to work again.
zadjii-msft Feb 9, 2023
7e91bdb
This actually seems to make the lifetime management worse - we just d…
zadjii-msft Feb 9, 2023
0395dc4
Revert "This actually seems to make the lifetime management worse - w…
zadjii-msft Feb 9, 2023
f904e5d
I give up and am moving on to the next TODOs. 8 TODOs remain
zadjii-msft Feb 10, 2023
4548729
Some additional cleanup of the WindowManager code
zadjii-msft Feb 10, 2023
7660937
and with that, we're ready to cleanup for review.
zadjii-msft Feb 10, 2023
0ad5b59
I think it's ready for review
zadjii-msft Feb 10, 2023
cfa6108
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/fore…
zadjii-msft Feb 10, 2023
e40575b
let's do it
zadjii-msft Feb 10, 2023
dffb416
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 10, 2023
a769933
merges are hard some times
zadjii-msft Feb 10, 2023
33685d9
bwahahahahaha
zadjii-msft Feb 13, 2023
a4f19a9
spel
zadjii-msft Feb 13, 2023
1ec8c0d
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 13, 2023
2621519
cleanup for review
zadjii-msft Feb 13, 2023
603a2ce
spel
zadjii-msft Feb 13, 2023
a9ac218
runformat
zadjii-msft Feb 13, 2023
82224bc
this was usnused
zadjii-msft Feb 13, 2023
d9d4d2e
get the tests to build, at least
zadjii-msft Feb 13, 2023
3f9deca
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 13, 2023
118bffa
fix the tests
zadjii-msft Feb 14, 2023
aa8b0c5
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 14, 2023
bc80943
the tests all...pass?
zadjii-msft Feb 14, 2023
667b658
I'm committing everything just in case, but I'm gonna revert and just…
zadjii-msft Feb 15, 2023
2bc578b
Revert "I'm committing everything just in case, but I'm gonna revert …
zadjii-msft Feb 15, 2023
62a4ee0
https://media.tenor.com/knFWHfkiwoUAAAAC/im-fine-hades.gif
zadjii-msft Feb 15, 2023
091f32c
a comment to go with the parent commit
zadjii-msft Feb 15, 2023
ecab57f
that was quite silly
zadjii-msft Feb 16, 2023
13257da
0 TODOs remain
zadjii-msft Feb 16, 2023
9a47396
[ainulindale] The Terminal shouldn't crash on a WM_SETTINGCHANGE
zadjii-msft Feb 23, 2023
273f2a8
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/fore…
zadjii-msft Feb 23, 2023
c79f27c
std::vectors are better
zadjii-msft Feb 27, 2023
b75fb24
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 27, 2023
cacb822
Dustin wanted a setting to opt-in to isolated mode, and this seems to…
zadjii-msft Feb 27, 2023
b589d09
Lots of PR nits
zadjii-msft Feb 28, 2023
0199aba
the last nits, I think
zadjii-msft Feb 28, 2023
5e23a72
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Feb 28, 2023
ada3f42
well that is an underwhelming codeformat commit. Thanks VS
zadjii-msft Feb 28, 2023
5164bff
hey that's a good point carlos
zadjii-msft Feb 28, 2023
7e2eb0d
Apply suggestions from code review
zadjii-msft Mar 2, 2023
5c852c3
some smaller nits
zadjii-msft Mar 2, 2023
1e331a0
Merge branch 'dev/migrie/oop/3/ainulindale' of https://github.com/mic…
zadjii-msft Mar 2, 2023
8e2c7a7
some cleanup
zadjii-msft Mar 2, 2023
08f6a53
This is gross but reduces the number of redundant copies of these bru…
zadjii-msft Mar 2, 2023
8803324
spelling is hard
zadjii-msft Mar 2, 2023
b983c69
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Mar 2, 2023
3aa083b
sure. It doesn't matter'
zadjii-msft Mar 2, 2023
9a9fa43
[ainulindale] Prevent a race between the Emperor and the window logic…
zadjii-msft Mar 6, 2023
b24cf61
some of the more minor cleanup elements
zadjii-msft Mar 7, 2023
3fa1017
one fewer IReference, thank gods
zadjii-msft Mar 7, 2023
5fe3fa5
some cleanup around expanding commands
zadjii-msft Mar 8, 2023
b0ca581
.detach so we don't std::explode()
zadjii-msft Mar 8, 2023
74af809
mmmm fresh cut code
zadjii-msft Mar 8, 2023
547b2c9
you never get used either
zadjii-msft Mar 8, 2023
6f6880c
this is more idomatic locking cause it's actually locking
zadjii-msft Mar 8, 2023
1dc2436
weak refs for fun and profit
zadjii-msft Mar 8, 2023
6e4b2e1
Guess what's LOAD BEARING
zadjii-msft Mar 9, 2023
7721813
pr nits
zadjii-msft Mar 9, 2023
6dead99
PR nits
zadjii-msft Mar 9, 2023
434abc2
Remove the need for TerminalPage to know the number of open windows
zadjii-msft Mar 9, 2023
1b59eb9
save this for later, we should only need ot look it up once
zadjii-msft Mar 9, 2023
39a9450
to wit, also make sure that there is a tablayout
zadjii-msft Mar 9, 2023
44b238e
Redo how ownership of WindowProperties works. This is cleaner by a go…
zadjii-msft Mar 9, 2023
073350e
fix the tests too
zadjii-msft Mar 10, 2023
ca511c9
this is why I don't use VS
zadjii-msft Mar 10, 2023
f70775a
I don't trust you phyllis
zadjii-msft Mar 10, 2023
81140a5
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Mar 10, 2023
339972e
tests build and pass again
zadjii-msft Mar 10, 2023
6d04353
yea we can fold this in
zadjii-msft Mar 10, 2023
1138416
hey let's make sure it still works
zadjii-msft Mar 10, 2023
9957e5c
I think that's the last of the nits
zadjii-msft Mar 10, 2023
6aec80b
A hotfix for the selfhost build
zadjii-msft Mar 13, 2023
0808f94
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/fore…
zadjii-msft Mar 17, 2023
5b3dc08
last nits, let's do this
zadjii-msft Mar 17, 2023
59b07f1
Merge branch 'dev/migrie/oop/3/foreword' into dev/migrie/oop/3/ainuli…
zadjii-msft Mar 17, 2023
7142ae8
[ainulindale] fix defterm
zadjii-msft Mar 16, 2023
d55bb43
[ainulindale] windows should get activated when they're created
zadjii-msft Mar 16, 2023
11f9957
[ainulindale] Friendship ended with callbacks
zadjii-msft Mar 17, 2023
55ee49b
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/ainu…
zadjii-msft Mar 17, 2023
1e4cc33
Merge remote-tracking branch 'origin/main' into dev/migrie/oop/3/ainu…
zadjii-msft Mar 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/spelling/allow/apis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ rcx
REGCLS
RETURNCMD
rfind
RLO
ROOTOWNER
roundf
RSHIFT
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"C_Cpp.loggingLevel": "None",
"files.associations": {
"xstring": "cpp",
"*.idl": "cpp",
"*.idl": "midl3",
"array": "cpp",
"future": "cpp",
"istream": "cpp",
Expand Down Expand Up @@ -106,4 +106,4 @@
"**/packages/**": true,
"**/Generated Files/**": true
}
}
}
7 changes: 6 additions & 1 deletion doc/cascadia/profiles.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@
"name": {
"type": "string",
"description": "The name of the theme. This will be displayed in the settings UI.",
"not": {
"not": {
"enum": [ "light", "dark", "system" ]
}
},
Expand Down Expand Up @@ -2092,6 +2092,11 @@
"description": "When set to true, the terminal will focus the pane on mouse hover.",
"type": "boolean"
},
"compatibility.isolatedMode": {
"default": false,
"description": "When set to true, Terminal windows will not be able to interact with each other (including global hotkeys, tab drag/drop, running commandlines in existing windows, etc.). This is a compatibility escape hatch for users who are running into certain windowing issues.",
"type": "boolean"
},
"copyFormatting": {
"default": true,
"description": "When set to `true`, the color and font formatting of selected text is also copied to your clipboard. When set to `false`, only plain text is copied to your clipboard. An array of specific formats can also be used. Supported array values include `html` and `rtf`. Plain text is always copied.",
Expand Down
128 changes: 91 additions & 37 deletions src/cascadia/LocalTests_TerminalApp/SettingsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,26 @@ namespace TerminalAppLocalTests
}
}
}
void _logCommands(winrt::Windows::Foundation::Collections::IVector<Command> commands, const int indentation = 1)
{
if (indentation == 1)
{
Log::Comment((commands.Size() == 0) ? L"Commands:\n <none>" : L"Commands:");
}
for (const auto& cmd : commands)
{
Log::Comment(fmt::format(L"{0:>{1}}* {2}",
L"",
indentation,
cmd.Name())
.c_str());

if (cmd.HasNestedCommands())
{
_logCommandNames(cmd.NestedCommands(), indentation + 2);
}
}
}
};

void SettingsTests::TestIterateCommands()
Expand Down Expand Up @@ -164,14 +184,15 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
}

auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
_logCommands(expandedCommands);

VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, expandedCommands.Size());

{
auto command = expandedCommands.Lookup(L"iterable command profile0");
auto command = expandedCommands.GetAt(0);
VERIFY_ARE_EQUAL(L"iterable command profile0", command.Name());
VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand All @@ -189,7 +210,8 @@ namespace TerminalAppLocalTests
}

{
auto command = expandedCommands.Lookup(L"iterable command profile1");
auto command = expandedCommands.GetAt(1);
VERIFY_ARE_EQUAL(L"iterable command profile1", command.Name());
VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand All @@ -207,7 +229,8 @@ namespace TerminalAppLocalTests
}

{
auto command = expandedCommands.Lookup(L"iterable command profile2");
auto command = expandedCommands.GetAt(2);
VERIFY_ARE_EQUAL(L"iterable command profile2", command.Name());
VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand Down Expand Up @@ -287,14 +310,16 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
}

auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
_logCommands(expandedCommands);

VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, expandedCommands.Size());

{
auto command = expandedCommands.Lookup(L"Split pane, profile: profile0");
auto command = expandedCommands.GetAt(0);
VERIFY_ARE_EQUAL(L"Split pane, profile: profile0", command.Name());

VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand All @@ -312,7 +337,9 @@ namespace TerminalAppLocalTests
}

{
auto command = expandedCommands.Lookup(L"Split pane, profile: profile1");
auto command = expandedCommands.GetAt(1);
VERIFY_ARE_EQUAL(L"Split pane, profile: profile1", command.Name());

VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand All @@ -330,7 +357,9 @@ namespace TerminalAppLocalTests
}

{
auto command = expandedCommands.Lookup(L"Split pane, profile: profile2");
auto command = expandedCommands.GetAt(2);
VERIFY_ARE_EQUAL(L"Split pane, profile: profile2", command.Name());

VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand Down Expand Up @@ -412,14 +441,16 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"${profile.name}", realArgs.TerminalArgs().Profile());
}

auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
_logCommands(expandedCommands);

VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, expandedCommands.Size());

{
auto command = expandedCommands.Lookup(L"iterable command profile0");
auto command = expandedCommands.GetAt(0);
VERIFY_ARE_EQUAL(L"iterable command profile0", command.Name());

VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand All @@ -437,7 +468,9 @@ namespace TerminalAppLocalTests
}

{
auto command = expandedCommands.Lookup(L"iterable command profile1\"");
auto command = expandedCommands.GetAt(1);
VERIFY_ARE_EQUAL(L"iterable command profile1\"", command.Name());

VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand All @@ -455,7 +488,9 @@ namespace TerminalAppLocalTests
}

{
auto command = expandedCommands.Lookup(L"iterable command profile2");
auto command = expandedCommands.GetAt(2);
VERIFY_ARE_EQUAL(L"iterable command profile2", command.Name());

VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand Down Expand Up @@ -527,14 +562,15 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());

auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
_logCommands(expandedCommands);

VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(1u, expandedCommands.Size());

auto rootCommand = expandedCommands.Lookup(L"Connect to ssh...");
auto rootCommand = expandedCommands.GetAt(0);
VERIFY_IS_NOT_NULL(rootCommand);
VERIFY_ARE_EQUAL(L"Connect to ssh...", rootCommand.Name());
auto rootActionAndArgs = rootCommand.ActionAndArgs();
VERIFY_IS_NOT_NULL(rootActionAndArgs);
VERIFY_ARE_EQUAL(ShortcutAction::Invalid, rootActionAndArgs.Action());
Expand Down Expand Up @@ -621,14 +657,16 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());

auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
_logCommands(expandedCommands);

VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(1u, expandedCommands.Size());

auto grandparentCommand = expandedCommands.Lookup(L"grandparent");
auto grandparentCommand = expandedCommands.GetAt(0);
VERIFY_IS_NOT_NULL(grandparentCommand);
VERIFY_ARE_EQUAL(L"grandparent", grandparentCommand.Name());

auto grandparentActionAndArgs = grandparentCommand.ActionAndArgs();
VERIFY_IS_NOT_NULL(grandparentActionAndArgs);
VERIFY_ARE_EQUAL(ShortcutAction::Invalid, grandparentActionAndArgs.Action());
Expand Down Expand Up @@ -744,17 +782,22 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());

auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
_logCommands(expandedCommands);

VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());

VERIFY_ARE_EQUAL(3u, expandedCommands.Size());

for (auto name : std::vector<std::wstring>({ L"profile0", L"profile1", L"profile2" }))
const std::vector<std::wstring> profileNames{ L"profile0", L"profile1", L"profile2" };
for (auto i = 0u; i < profileNames.size(); i++)
{
winrt::hstring commandName{ name + L"..." };
auto command = expandedCommands.Lookup(commandName);
const auto& name{ profileNames[i] };
winrt::hstring commandName{ profileNames[i] + L"..." };

auto command = expandedCommands.GetAt(i);
VERIFY_ARE_EQUAL(commandName, command.Name());

VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand Down Expand Up @@ -880,14 +923,16 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());

auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
_logCommands(expandedCommands);

VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(1u, expandedCommands.Size());

auto rootCommand = expandedCommands.Lookup(L"New Tab With Profile...");
auto rootCommand = expandedCommands.GetAt(0);
VERIFY_IS_NOT_NULL(rootCommand);
VERIFY_ARE_EQUAL(L"New Tab With Profile...", rootCommand.Name());

auto rootActionAndArgs = rootCommand.ActionAndArgs();
VERIFY_IS_NOT_NULL(rootActionAndArgs);
VERIFY_ARE_EQUAL(ShortcutAction::Invalid, rootActionAndArgs.Action());
Expand Down Expand Up @@ -982,13 +1027,16 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(3u, settings.ActiveProfiles().Size());

auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(settings.ActionMap().NameMap(), settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
_logCommands(expandedCommands);

VERIFY_ARE_EQUAL(0u, settings.Warnings().Size());
VERIFY_ARE_EQUAL(1u, expandedCommands.Size());

auto rootCommand = expandedCommands.Lookup(L"New Pane...");
auto rootCommand = expandedCommands.GetAt(0);
VERIFY_IS_NOT_NULL(rootCommand);
VERIFY_ARE_EQUAL(L"New Pane...", rootCommand.Name());

VERIFY_IS_NOT_NULL(rootCommand);
auto rootActionAndArgs = rootCommand.ActionAndArgs();
VERIFY_IS_NOT_NULL(rootActionAndArgs);
Expand Down Expand Up @@ -1205,8 +1253,8 @@ namespace TerminalAppLocalTests
VERIFY_ARE_EQUAL(L"${scheme.name}", realArgs.TerminalArgs().Profile());
}

auto expandedCommands = winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(nameMap, settings.ActiveProfiles().GetView(), settings.GlobalSettings().ColorSchemes());
_logCommandNames(expandedCommands.GetView());
const auto& expandedCommands{ settings.GlobalSettings().ActionMap().ExpandedCommands() };
_logCommands(expandedCommands);

VERIFY_ARE_EQUAL(3u, expandedCommands.Size());

Expand All @@ -1215,7 +1263,9 @@ namespace TerminalAppLocalTests
// just easy tests to write.

{
auto command = expandedCommands.Lookup(L"iterable command Campbell");
auto command = expandedCommands.GetAt(0);
VERIFY_ARE_EQUAL(L"iterable command Campbell", command.Name());

VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand All @@ -1233,7 +1283,9 @@ namespace TerminalAppLocalTests
}

{
auto command = expandedCommands.Lookup(L"iterable command Campbell PowerShell");
auto command = expandedCommands.GetAt(1);
VERIFY_ARE_EQUAL(L"iterable command Campbell PowerShell", command.Name());

VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand All @@ -1251,7 +1303,9 @@ namespace TerminalAppLocalTests
}

{
auto command = expandedCommands.Lookup(L"iterable command Vintage");
auto command = expandedCommands.GetAt(2);
VERIFY_ARE_EQUAL(L"iterable command Vintage", command.Name());

VERIFY_IS_NOT_NULL(command);
auto actionAndArgs = command.ActionAndArgs();
VERIFY_IS_NOT_NULL(actionAndArgs);
Expand Down
Loading