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

Add support for running a commandline in another WT window #8898

Merged
60 commits merged into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
3bef7bb
Get all the projects created and hooked up to the sln
zadjii-msft Dec 16, 2020
1f52d35
Yank all the M/P files, this builds?!
zadjii-msft Dec 16, 2020
5a9cdc8
Shockingly, this works, it works elevated, and it works unpackaged
zadjii-msft Dec 16, 2020
36539cf
This won't work, but I'm committing this becaus I finally got it to c…
zadjii-msft Dec 16, 2020
27ace16
whoop, we pass the commandline from the peasant, to the monarch, and …
zadjii-msft Dec 16, 2020
9a41647
HOLY SHIT I GOT THE COMANDLINE TO EXECUTE IN THE CURRENT WINDOW!!!!!!…
zadjii-msft Dec 17, 2020
5cabcfb
add a note to future me
zadjii-msft Dec 17, 2020
03bfc6e
This works as a unittest, but not a local test. That's batty
zadjii-msft Dec 17, 2020
590b9ff
this macro makes me feel dirty
zadjii-msft Dec 17, 2020
0579b24
LocalTests_Remoting -> UnitTests_Remoting
zadjii-msft Dec 17, 2020
a3faed6
finish renaming this test
zadjii-msft Dec 17, 2020
9c6eac4
Clean up a lot for review
zadjii-msft Dec 17, 2020
0103331
cleanup Peasant for review
zadjii-msft Dec 17, 2020
b4fe1bf
Final cleanup for review
zadjii-msft Dec 17, 2020
d08e65c
_final_ final cleanup for review
zadjii-msft Dec 17, 2020
e101efd
pr nits
zadjii-msft Dec 18, 2020
e1402d8
This seems to work to create a thread listening for the monarch, and …
zadjii-msft Dec 18, 2020
f978a9c
it's hard to believe he's gone / were it so easy
zadjii-msft Dec 18, 2020
5939636
Oh yea actually remove the thing
zadjii-msft Dec 18, 2020
c088895
last commit before the holidays
zadjii-msft Dec 18, 2020
fa2df47
Merge remote-tracking branch 'origin/main' into dev/migrie/f/remoting…
zadjii-msft Jan 5, 2021
0f5c24f
Enable audit mode
zadjii-msft Jan 5, 2021
921d915
nits
zadjii-msft Jan 5, 2021
00184e7
Merge branch 'dev/migrie/f/remoting.dll' into dev/migrie/f/the-first-…
zadjii-msft Jan 5, 2021
658db6b
Ask the TerminalApp to parse the commandline, and tell us what the wi…
zadjii-msft Jan 6, 2021
977db46
Holy bajesus, this works like a charm
zadjii-msft Jan 6, 2021
bcbef34
Add a note about commiting suicide
zadjii-msft Jan 6, 2021
813dbc6
notes, comments, cleanup
zadjii-msft Jan 6, 2021
0f0df5e
activate windows
zadjii-msft Jan 6, 2021
9fc2f0e
add some tracelogging
zadjii-msft Jan 6, 2021
6537686
The peasant will now correctly inform the monarch when it re-connects
zadjii-msft Jan 7, 2021
a75da0a
mostly just notes
zadjii-msft Jan 7, 2021
c02f25a
peasants now switch to the cwd that was requested
zadjii-msft Jan 7, 2021
3e39ab9
more comments
zadjii-msft Jan 7, 2021
52b2cb6
Allow the user to provide ids on the commandline
zadjii-msft Jan 7, 2021
bc492f1
Code cleanup
zadjii-msft Jan 7, 2021
88ffc6f
Merge remote-tracking branch 'origin/main' into dev/migrie/f/remoting…
zadjii-msft Jan 7, 2021
be74b2e
putting var in headers is bad, mkay?
zadjii-msft Jan 7, 2021
2a7bc94
branding
zadjii-msft Jan 7, 2021
81c09d9
Merge branch 'dev/migrie/f/remoting.dll' into dev/migrie/f/the-first-…
zadjii-msft Jan 8, 2021
c34e4ce
Merge remote-tracking branch 'origin/main' into dev/migrie/f/the-firs…
zadjii-msft Jan 8, 2021
5b8ace2
A bunch of tests for Monarch::ProposeCommandline
zadjii-msft Jan 8, 2021
689c385
sure yea that's a doc comment
zadjii-msft Jan 8, 2021
59deca1
Merge branch 'main' into dev/migrie/f/the-first-galactic-empire
zadjii-msft Jan 26, 2021
f02969b
More tests, more redundancy
zadjii-msft Jan 26, 2021
b2db317
man I can't spel
zadjii-msft Jan 26, 2021
d2a3438
Add try/catch's throughout Monarch.cpp
zadjii-msft Jan 27, 2021
a65f341
trycatch the window manager. A lot more going on there.
zadjii-msft Jan 27, 2021
faf4544
add some abstracts
zadjii-msft Jan 29, 2021
19765b1
Apply suggestions from code review
zadjii-msft Jan 29, 2021
4e007ae
a ton of PR feedback
zadjii-msft Jan 29, 2021
c493607
bunch of PR feedback
zadjii-msft Feb 2, 2021
8de368a
Merge remote-tracking branch 'origin/main' into dev/migrie/f/the-firs…
zadjii-msft Feb 2, 2021
e6bd315
!!! THIS NEEDS TO BE MOVED TO THE PARENT BRANCH !!!
zadjii-msft Jan 28, 2021
a62d53f
!!! THIS NEEDS TO BE MOVED TO THE PARENT BRANCH !!!
zadjii-msft Jan 28, 2021
147b187
!!! THIS NEEDS TO BE MOVED TO THE PARENT BRANCH !!!
zadjii-msft Jan 28, 2021
a102f44
bad merge
zadjii-msft Feb 2, 2021
b627fd9
Merge remote-tracking branch 'origin/main' into dev/migrie/f/the-firs…
zadjii-msft Feb 2, 2021
2367db1
What? No yea I always run the tests
zadjii-msft Feb 2, 2021
c29fbe7
Merge remote-tracking branch 'origin/main' into dev/migrie/f/the-firs…
zadjii-msft Feb 9, 2021
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/spell-check/expect/web.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ fixterms
uk
winui
appshellintegration
cppreference
11 changes: 7 additions & 4 deletions OpenConsole.sln
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTests_Remoting", "src\c
{27B5AAEB-A548-44CF-9777-F8BAA32AF7AE} = {27B5AAEB-A548-44CF-9777-F8BAA32AF7AE}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wpf", "wpf", "{4DAF0299-495E-4CD1-A982-9BAC16A45932}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
AuditMode|Any CPU = AuditMode|Any CPU
Expand Down Expand Up @@ -2475,7 +2477,7 @@ Global
{43CE4CE5-0010-4B99-9569-672670D26E26}.AuditMode|DotNet_x64Test.ActiveCfg = AuditMode|Win32
{43CE4CE5-0010-4B99-9569-672670D26E26}.AuditMode|DotNet_x86Test.ActiveCfg = AuditMode|Win32
{43CE4CE5-0010-4B99-9569-672670D26E26}.AuditMode|x64.ActiveCfg = Release|x64
{43CE4CE5-0010-4B99-9569-672670D26E26}.AuditMode|x64.Build.0 = AuditMode|x64
{43CE4CE5-0010-4B99-9569-672670D26E26}.AuditMode|x64.Build.0 = Release|x64
{43CE4CE5-0010-4B99-9569-672670D26E26}.AuditMode|x86.ActiveCfg = AuditMode|Win32
{43CE4CE5-0010-4B99-9569-672670D26E26}.AuditMode|x86.Build.0 = AuditMode|Win32
{43CE4CE5-0010-4B99-9569-672670D26E26}.Debug|Any CPU.ActiveCfg = Debug|Win32
Expand Down Expand Up @@ -2613,8 +2615,8 @@ Global
{05500DEF-2294-41E3-AF9A-24E580B82836} = {89CDCC5C-9F53-4054-97A4-639D99F169CD}
{1E4A062E-293B-4817-B20D-BF16B979E350} = {89CDCC5C-9F53-4054-97A4-639D99F169CD}
{34DE34D3-1CD6-4EE3-8BD9-A26B5B27EC73} = {89CDCC5C-9F53-4054-97A4-639D99F169CD}
{84848BFA-931D-42CE-9ADF-01EE54DE7890} = {59840756-302F-44DF-AA47-441A9D673202}
{376FE273-6B84-4EB5-8B30-8DE9D21B022C} = {59840756-302F-44DF-AA47-441A9D673202}
{84848BFA-931D-42CE-9ADF-01EE54DE7890} = {4DAF0299-495E-4CD1-A982-9BAC16A45932}
{376FE273-6B84-4EB5-8B30-8DE9D21B022C} = {4DAF0299-495E-4CD1-A982-9BAC16A45932}
{CA5CAD1A-9333-4D05-B12A-1905CBF112F9} = {BDB237B6-1D1D-400F-84CC-40A58FA59C8E}
{CA5CAD1A-9A12-429C-B551-8562EC954746} = {59840756-302F-44DF-AA47-441A9D673202}
{CA5CAD1A-B11C-4DDB-A4FE-C3AFAE9B5506} = {BDB237B6-1D1D-400F-84CC-40A58FA59C8E}
Expand All @@ -2634,7 +2636,7 @@ Global
{024052DE-83FB-4653-AEA4-90790D29D5BD} = {E8F24881-5E37-4362-B191-A3BA0ED7F4EB}
{067F0A06-FCB7-472C-96E9-B03B54E8E18D} = {59840756-302F-44DF-AA47-441A9D673202}
{6BAE5851-50D5-4934-8D5E-30361A8A40F3} = {81C352DB-1818-45B7-A284-18E259F1CC87}
{1588FD7C-241E-4E7D-9113-43735F3E6BAD} = {59840756-302F-44DF-AA47-441A9D673202}
{1588FD7C-241E-4E7D-9113-43735F3E6BAD} = {4DAF0299-495E-4CD1-A982-9BAC16A45932}
{506FD703-BAA7-4F6E-9361-64F550EC8FCA} = {59840756-302F-44DF-AA47-441A9D673202}
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32} = {59840756-302F-44DF-AA47-441A9D673202}
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907} = {59840756-302F-44DF-AA47-441A9D673202}
Expand All @@ -2645,6 +2647,7 @@ Global
{43CE4CE5-0010-4B99-9569-672670D26E26} = {59840756-302F-44DF-AA47-441A9D673202}
{27B5AAEB-A548-44CF-9777-F8BAA32AF7AE} = {59840756-302F-44DF-AA47-441A9D673202}
{68A10CD3-AA64-465B-AF5F-ED4E9700543C} = {BDB237B6-1D1D-400F-84CC-40A58FA59C8E}
{4DAF0299-495E-4CD1-A982-9BAC16A45932} = {59840756-302F-44DF-AA47-441A9D673202}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3140B1B7-C8EE-43D1-A772-D82A7061A271}
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/CascadiaPackage/CascadiaPackage.wapproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PropertyGroup Label="Configuration">
<!-- This is necessary so the build system doesn't think we're a .NET project... -->
<TargetRuntime>Native</TargetRuntime>
<NuGetTargetMoniker>win</NuGetTargetMoniker>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
<!--
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/Remoting/CommandlineArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// It must be defined after CommandlineArgs.g.cpp, otherwise the compiler
// will give you just the most impossible template errors to try and
// decipher.
void CommandlineArgs::Args(winrt::array_view<const winrt::hstring> const& value)
void CommandlineArgs::Commandline(winrt::array_view<const winrt::hstring> const& value)
{
_args = { value.begin(), value.end() };
}

winrt::com_array<winrt::hstring> CommandlineArgs::Args()
winrt::com_array<winrt::hstring> CommandlineArgs::Commandline()
{
return winrt::com_array<winrt::hstring>{ _args.begin(), _args.end() };
}
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/Remoting/CommandlineArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation

winrt::hstring CurrentDirectory() { return _cwd; };

void Args(winrt::array_view<const winrt::hstring> const& value);
winrt::com_array<winrt::hstring> Args();
void Commandline(winrt::array_view<const winrt::hstring> const& value);
winrt::com_array<winrt::hstring> Commandline();

private:
winrt::com_array<winrt::hstring> _args;
Expand Down
5 changes: 5 additions & 0 deletions src/cascadia/Remoting/FindTargetWindowArgs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "FindTargetWindowArgs.h"
#include "FindTargetWindowArgs.g.cpp"
36 changes: 36 additions & 0 deletions src/cascadia/Remoting/FindTargetWindowArgs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.

Class Name:
- FindTargetWindowArgs.h

Abstract:
- This is a helper class for determining which window a specific commandline is
intended for. The Monarch will create one of these, then toss it over to
TerminalApp. TerminalApp actually contains the logic for parsing a
commandline, as well as settings like the windowing behavior. Once the
TerminalApp determines the correct window, it'll fill in the
ResultTargetWindow property. The monarch will then read that value out to
invoke the commandline in the appropriate window.

--*/

#pragma once

#include "FindTargetWindowArgs.g.h"
#include "../cascadia/inc/cppwinrt_utils.h"

namespace winrt::Microsoft::Terminal::Remoting::implementation
{
struct FindTargetWindowArgs : public FindTargetWindowArgsT<FindTargetWindowArgs>
{
GETSET_PROPERTY(winrt::Microsoft::Terminal::Remoting::CommandlineArgs, Args, nullptr);
GETSET_PROPERTY(int, ResultTargetWindow, -1);

public:
FindTargetWindowArgs(winrt::Microsoft::Terminal::Remoting::CommandlineArgs args) :
_Args{ args } {};
};
}
BASIC_FACTORY(FindTargetWindowArgs);
19 changes: 19 additions & 0 deletions src/cascadia/Remoting/Microsoft.Terminal.RemotingLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
<ClInclude Include="Monarch.h">
<DependentUpon>Monarch.idl</DependentUpon>
</ClInclude>
<ClInclude Include="FindTargetWindowArgs.h">
<DependentUpon>Monarch.idl</DependentUpon>
</ClInclude>
<ClInclude Include="ProposeCommandlineResult.h">
<DependentUpon>Monarch.idl</DependentUpon>
</ClInclude>
<ClInclude Include="WindowActivatedArgs.h">
<DependentUpon>Peasant.idl</DependentUpon>
</ClInclude>
<ClInclude Include="pch.h" />
<ClInclude Include="MonarchFactory.h" />
<ClInclude Include="Peasant.h">
Expand All @@ -36,6 +45,15 @@
<ClCompile Include="Monarch.cpp">
<DependentUpon>Monarch.idl</DependentUpon>
</ClCompile>
<ClCompile Include="FindTargetWindowArgs.cpp">
<DependentUpon>Monarch.idl</DependentUpon>
</ClCompile>
<ClCompile Include="ProposeCommandlineResult.cpp">
<DependentUpon>Monarch.idl</DependentUpon>
</ClCompile>
<ClCompile Include="WindowActivatedArgs.cpp">
<DependentUpon>Peasant.idl</DependentUpon>
</ClCompile>
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
Expand All @@ -49,6 +67,7 @@
<DependentUpon>Peasant.idl</DependentUpon>
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="init.cpp" />
</ItemGroup>
<!-- ========================= idl Files ======================== -->
<ItemGroup>
Expand Down
Loading