Compare commits

...

49 Commits

Author SHA1 Message Date
Mike Griese
6b467fe245 Merge remote-tracking branch 'origin/main' into dev/migrie/b/9053-part-3-the-actual-doing-of-the-thing 2023-04-17 09:38:34 -05:00
Mike Griese
03c1430d6f Always show from explorer. Closes #15193 2023-04-17 09:38:19 -05:00
Mike Griese
049f940134 Merge remote-tracking branch 'origin/main' into dev/migrie/b/9053-part-3-the-actual-doing-of-the-thing 2023-04-17 08:50:57 -05:00
Mike Griese
c448749fb4 fix the tests 2023-04-11 10:07:20 -05:00
Mike Griese
e20d0dd9c5 Merge branch 'main' into dev/migrie/b/9053-part-3-the-actual-doing-of-the-thing 2023-04-11 09:01:38 -05:00
Mike Griese
df08a66f7d Merge remote-tracking branch 'origin/main' into dev/migrie/b/9053-part-3-the-actual-doing-of-the-thing 2023-04-06 13:05:24 -05:00
Mike Griese
e6d96cf5a6 Merge branch 'dev/migrie/b/9053-attempt-2' into dev/migrie/b/9053-part-3-the-actual-doing-of-the-thing 2023-04-06 11:57:14 -05:00
Mike Griese
5289c238f2 You know, I don't think we need allowsetforeground 2023-04-06 11:56:54 -05:00
Mike Griese
b7ea20cb13 update this comment 2023-04-06 10:51:13 -05:00
Mike Griese
9cbf883829 I'll stame you 2023-04-06 10:48:18 -05:00
Mike Griese
46db89cc51 I cannot believe it was that easy 2023-04-06 09:43:40 -05:00
Mike Griese
e7afa5b6f6 Merge branch 'dev/migrie/b/9053-attempt-2' into dev/migrie/b/9053-part-3-the-actual-doing-of-the-thing 2023-04-05 16:41:07 -05:00
Mike Griese
35db280366 VS *shake fist* 2023-04-05 16:28:42 -05:00
Mike Griese
02f5bfa9ce cleanup comment 2023-04-05 16:20:26 -05:00
Mike Griese
e67bfb3380 this is cleaner 2023-04-05 16:08:33 -05:00
Mike Griese
431b26aa58 as it turns out, we don't need the invalidate. that's at least _less_ dumb 2023-04-05 16:02:52 -05:00
Mike Griese
6a99f25d6d as a point of bookmarking - this works 2023-04-05 15:49:12 -05:00
Mike Griese
8b14a22e5c Merge branch 'main' into dev/migrie/b/9053-attempt-2
# Conflicts:
#	src/cascadia/TerminalApp/AppLogic.h
#	src/cascadia/TerminalApp/AppLogic.idl
#	src/cascadia/TerminalApp/TerminalPage.cpp
#	src/cascadia/WindowsTerminal/AppHost.cpp
#	src/cascadia/WindowsTerminal/AppHost.h
2023-04-05 15:05:42 -05:00
Mike Griese
e99af2dc48 Merge branch 'main' into dev/migrie/b/9053-attempt-2 2023-01-24 06:53:06 -06:00
Mike Griese
6a2074156c Merge branch 'dev/migrie/b/9053-attempt-2' of https://github.com/microsoft/terminal into dev/migrie/b/9053-attempt-2 2022-12-01 17:15:05 -06:00
Mike Griese
8c66d9092e Merge remote-tracking branch 'origin/main' into dev/migrie/b/9053-attempt-2 2022-12-01 14:01:16 -06:00
Dustin L. Howett
b37ed82fc6 Migrate spelling-0.0.21 changes from main 2022-08-26 06:16:57 -05:00
Mike Griese
42a5fc9590 Merge remote-tracking branch 'origin/main' into dev/migrie/b/9053-attempt-2 2022-08-26 06:16:57 -05:00
Dustin L. Howett
7fca59f301 Migrate spelling-0.0.21 changes from main 2022-08-22 11:04:15 -05:00
Mike Griese
9bb5fbb65b Revert "until we can be sure, lets take this out"
This reverts commit 1fac403556.
2022-08-22 11:04:15 -05:00
Mike Griese
1fac403556 until we can be sure, lets take this out 2022-08-22 10:55:44 -05:00
Mike Griese
c34495dcfc yea this does it 2022-08-19 13:14:13 -05:00
Mike Griese
a1fd241604 Well this fixes it but I need to sort out the last bits of the launchmode 2022-08-19 13:04:44 -05:00
Mike Griese
4c08b9a1bc Revert "Revert "Hide the window from DWM until we're finished with initialization (#12979)" (#13098)"
This reverts commit 6ffc3dc7a8.
2022-08-19 12:55:17 -05:00
Mike Griese
38de95efa8 Code review notes 2022-08-19 10:04:37 -05:00
Mike Griese
58492798c4 Merge branch 'main' into dev/migrie/f/9458-startupInfoToTerminal 2022-08-19 06:34:28 -05:00
Mike Griese
3ce349e81b big s/o to whoever added the onecore projects to the oss repo, so we caught it 2022-08-12 12:56:07 -05:00
Mike Griese
d2336e3831 Merge remote-tracking branch 'origin/main' into dev/migrie/f/9458-startupInfoToTerminal 2022-08-11 10:21:11 -05:00
Mike Griese
18a62bdae7 I think I'm gonna need to put EVERYTHING in here 2022-07-26 10:43:36 -05:00
Mike Griese
01420b9902 Merge remote-tracking branch 'origin/main' into dev/migrie/f/9458-startupInfoToTerminal 2022-07-26 10:30:17 -05:00
Mike Griese
5bf3c1ee50 had this all before the long weekend 2022-07-26 10:29:48 -05:00
Mike Griese
879a955f3b more comments, cleanup 2022-07-22 13:13:31 -05:00
Mike Griese
e333661a15 cleanup for review 2022-07-22 13:08:27 -05:00
Mike Griese
7268e96ef0 Remove scratch work 2022-07-22 11:00:10 -05:00
Mike Griese
c0b4840dcd Merge remote-tracking branch 'origin/main' into dev/migrie/f/9458-startupInfoToTerminal 2022-07-22 07:13:20 -05:00
Mike Griese
4b717db6f0 Merge remote-tracking branch 'origin/main' into dev/migrie/f/9458-startupInfoToTerminal 2022-07-22 07:13:04 -05:00
Mike Griese
fd75c5e1ea I think this is all the prototyping I need 2022-07-21 15:07:52 -05:00
Mike Griese
9a2ee6a7c2 Cleanup, comments, etc. 2022-07-19 12:30:26 -05:00
Mike Griese
dc78b3267a this does temporarily get the title out of the link, but then it's lose 2022-07-19 12:07:03 -05:00
Mike Griese
874a15b89b Good-news-everyone.gif
This hooks up the defterm interface to pass more info along in the startup. It's notably not the actual link title, but it does work from a plumbing standpoint

  This is for #9458
2022-07-19 11:14:17 -05:00
Mike Griese
1dd6e99340 prototype 2022-07-18 16:57:00 -05:00
Mike Griese
11bfc73400 A BLANK SCRATCH COMMIT 2022-07-18 15:05:42 -05:00
Mike Griese
c795793f4c Revert "I just want to run the scratch project, I have no idea how this got so brboken"
This reverts commit 103beb4be1.
2022-07-18 14:59:58 -05:00
Mike Griese
103beb4be1 I just want to run the scratch project, I have no idea how this got so brboken 2022-07-18 14:59:19 -05:00
11 changed files with 54 additions and 24 deletions

View File

@@ -804,6 +804,7 @@ HIBYTE
hicon
HIDEWINDOW
hinst
Hirots
HISTORYBUFS
HISTORYNODUP
HISTORYSIZE

View File

@@ -14,9 +14,11 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
}
CommandlineArgs(const winrt::array_view<const winrt::hstring>& args,
winrt::hstring currentDirectory) :
winrt::hstring currentDirectory,
const uint32_t showWindowCommand) :
_args{ args.begin(), args.end() },
_cwd{ currentDirectory }
_cwd{ currentDirectory },
_ShowWindowCommand{ showWindowCommand }
{
}
@@ -25,6 +27,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
void Commandline(const winrt::array_view<const winrt::hstring>& value);
winrt::com_array<winrt::hstring> Commandline();
WINRT_PROPERTY(uint32_t, ShowWindowCommand, SW_NORMAL); // SW_NORMAL is 1, 0 is SW_HIDE
private:
winrt::com_array<winrt::hstring> _args;
winrt::hstring _cwd;

View File

@@ -46,7 +46,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
_Id{ windowInfo.Id() ? windowInfo.Id().Value() : 0 }, // We'll use 0 as a sentinel, since no window will ever get to have that ID
_WindowName{ windowInfo.WindowName() },
_args{ command.Commandline() },
_CurrentDirectory{ command.CurrentDirectory() } {};
_CurrentDirectory{ command.CurrentDirectory() },
_ShowWindowCommand{ command.ShowWindowCommand() } {};
WindowRequestedArgs(const winrt::hstring& window, const winrt::hstring& content, const Windows::Foundation::IReference<Windows::Foundation::Rect>& bounds) :
_Id{ 0u },
@@ -63,6 +64,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
WINRT_PROPERTY(winrt::hstring, WindowName);
WINRT_PROPERTY(winrt::hstring, CurrentDirectory);
WINRT_PROPERTY(winrt::hstring, Content);
WINRT_PROPERTY(uint32_t, ShowWindowCommand, SW_NORMAL);
WINRT_PROPERTY(Windows::Foundation::IReference<Windows::Foundation::Rect>, InitialBounds);
private:

View File

@@ -26,6 +26,7 @@ namespace Microsoft.Terminal.Remoting
String[] Commandline { get; };
String CurrentDirectory { get; };
UInt32 ShowWindowCommand { get; };
String Content { get; };
Windows.Foundation.IReference<Windows.Foundation.Rect> InitialBounds { get; };

View File

@@ -7,10 +7,11 @@ namespace Microsoft.Terminal.Remoting
runtimeclass CommandlineArgs
{
CommandlineArgs();
CommandlineArgs(String[] args, String cwd);
CommandlineArgs(String[] args, String cwd, UInt32 showWindowCommand);
String[] Commandline { get; set; };
String CurrentDirectory();
UInt32 ShowWindowCommand { get; };
};
runtimeclass RenameRequestArgs

View File

@@ -350,7 +350,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
// If the name wasn't specified, this will be an empty string.
p->WindowName(args.WindowName());
p->ExecuteCommandline(*winrt::make_self<CommandlineArgs>(args.Commandline(), args.CurrentDirectory()));
p->ExecuteCommandline(*winrt::make_self<CommandlineArgs>(args.Commandline(), args.CurrentDirectory(), args.ShowWindowCommand()));
_monarch.AddPeasant(*p);

View File

@@ -44,6 +44,10 @@ try
STARTUPINFOEX siEx{ 0 };
siEx.StartupInfo.cb = sizeof(STARTUPINFOEX);
// Explicitly create the terminal window visible.
siEx.StartupInfo.dwFlags |= STARTF_USESHOWWINDOW;
siEx.StartupInfo.wShowWindow = SW_SHOWNORMAL;
std::filesystem::path modulePath{ wil::GetModuleFileNameW<std::wstring>(wil::GetModuleInstanceHandle()) };
std::wstring cmdline;
if (runElevated)

View File

@@ -431,7 +431,7 @@ namespace RemotingUnitTests
m0->FindTargetWindowRequested(&RemotingTests::_findTargetWindowHelper);
std::vector<winrt::hstring> args{};
Remoting::CommandlineArgs eventArgs{ { args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(true, result.ShouldCreateWindow());
@@ -468,7 +468,7 @@ namespace RemotingUnitTests
});
std::vector<winrt::hstring> args{ L"1", L"arg[1]" };
Remoting::CommandlineArgs eventArgs{ { args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(false, result.ShouldCreateWindow());
@@ -489,7 +489,7 @@ namespace RemotingUnitTests
{
std::vector<winrt::hstring> args{ L"-1" };
Remoting::CommandlineArgs eventArgs{ { args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(true, result.ShouldCreateWindow());
@@ -497,7 +497,7 @@ namespace RemotingUnitTests
}
{
std::vector<winrt::hstring> args{ L"-2" };
Remoting::CommandlineArgs eventArgs{ { args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(true, result.ShouldCreateWindow());
@@ -534,7 +534,7 @@ namespace RemotingUnitTests
winrt::clock().now() };
p1->ActivateWindow(activatedArgs);
Remoting::CommandlineArgs eventArgs{ { p1Args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { p1Args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(false, result.ShouldCreateWindow());
@@ -559,7 +559,7 @@ namespace RemotingUnitTests
p2->ActivateWindow(activatedArgs);
Log::Comment(L"Send a commandline to the current window, which should be p2");
Remoting::CommandlineArgs eventArgs{ { p2Args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { p2Args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(false, result.ShouldCreateWindow());
VERIFY_ARE_EQUAL(false, (bool)result.Id());
@@ -572,7 +572,7 @@ namespace RemotingUnitTests
p1->ActivateWindow(activatedArgs);
Log::Comment(L"Send a commandline to the current window, which should be p1 again");
Remoting::CommandlineArgs eventArgs{ { p1Args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { p1Args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(false, result.ShouldCreateWindow());
VERIFY_ARE_EQUAL(false, (bool)result.Id());
@@ -593,7 +593,7 @@ namespace RemotingUnitTests
{
std::vector<winrt::hstring> args{ L"2" };
Remoting::CommandlineArgs eventArgs{ { args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(true, result.ShouldCreateWindow());
@@ -602,7 +602,7 @@ namespace RemotingUnitTests
}
{
std::vector<winrt::hstring> args{ L"10" };
Remoting::CommandlineArgs eventArgs{ { args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(true, result.ShouldCreateWindow());
@@ -648,7 +648,7 @@ namespace RemotingUnitTests
{
Log::Comment(L"Send a commandline to p2, who is still alive. We won't create a new window.");
Remoting::CommandlineArgs eventArgs{ { p2Args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { p2Args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(false, result.ShouldCreateWindow());
@@ -656,7 +656,7 @@ namespace RemotingUnitTests
}
{
Log::Comment(L"Send a commandline to p1, who is dead. We will create a new window.");
Remoting::CommandlineArgs eventArgs{ { p1Args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { p1Args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(true, result.ShouldCreateWindow());
@@ -1359,7 +1359,7 @@ namespace RemotingUnitTests
std::vector<winrt::hstring> p2Args{ L"two", L"this is for p2" };
{
Remoting::CommandlineArgs eventArgs{ { p1Args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { p1Args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(false, result.ShouldCreateWindow());
VERIFY_ARE_EQUAL(false, (bool)result.Id()); // Casting to (bool) checks if the reference has a value
@@ -1368,7 +1368,7 @@ namespace RemotingUnitTests
{
Log::Comment(L"Send a commandline to \"two\", which should be p2");
Remoting::CommandlineArgs eventArgs{ { p2Args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { p2Args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(false, result.ShouldCreateWindow());
VERIFY_ARE_EQUAL(false, (bool)result.Id()); // Casting to (bool) checks if the reference has a value
@@ -1380,7 +1380,7 @@ namespace RemotingUnitTests
{
Log::Comment(L"Send a commandline to \"two\", who is now dead.");
Remoting::CommandlineArgs eventArgs{ { p2Args }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { p2Args }, { L"" }, SW_NORMAL };
auto result = m0->ProposeCommandline(eventArgs);
VERIFY_ARE_EQUAL(true, result.ShouldCreateWindow());
VERIFY_ARE_EQUAL(false, (bool)result.Id()); // Casting to (bool) checks if the reference has a value
@@ -2392,7 +2392,7 @@ namespace RemotingUnitTests
VERIFY_ARE_EQUAL(p1->GetID(), m0->_mruPeasants[1].PeasantID());
std::vector<winrt::hstring> commandlineArgs{ L"0", L"arg[1]" };
Remoting::CommandlineArgs eventArgs{ { commandlineArgs }, { L"" } };
Remoting::CommandlineArgs eventArgs{ { commandlineArgs }, { L"" }, SW_NORMAL };
Log::Comment(L"When we attempt to send a commandline to the MRU window,"
L" we should find peasant 1 (who's name is \"one\"), not 2"
@@ -2577,7 +2577,7 @@ namespace RemotingUnitTests
auto m0 = make_private<Remoting::implementation::Monarch>(monarch0PID);
{
Remoting::CommandlineArgs args{ { L"wt.exe" }, { L"-Embedding" } };
Remoting::CommandlineArgs args{ { L"wt.exe" }, { L"-Embedding" }, SW_NORMAL };
const auto result = m0->ProposeCommandline(args);
auto shouldCreateWindow = result.ShouldCreateWindow();
VERIFY_IS_TRUE(shouldCreateWindow);
@@ -2585,7 +2585,7 @@ namespace RemotingUnitTests
auto m1 = make_self<DeadMonarch>();
{
Remoting::CommandlineArgs args{ { L"wt.exe" }, { L"-Embedding" } };
Remoting::CommandlineArgs args{ { L"wt.exe" }, { L"-Embedding" }, SW_NORMAL };
try
{

View File

@@ -188,6 +188,8 @@ void AppHost::_HandleCommandlineArgs(const Remoting::WindowRequestedArgs& window
}
}
_launchShowWindowCommand = windowArgs.ShowWindowCommand();
// This is a fix for GH#12190 and hopefully GH#12169.
//
// If the commandline we were provided is going to result in us only
@@ -1247,7 +1249,12 @@ winrt::fire_and_forget AppHost::_WindowInitializedHandler(const winrt::Windows::
// match the initial settings, and then call ShowWindow to finally make us
// visible.
auto nCmdShow = SW_SHOW;
// Use the visibility that we were originally requested with as a base. We
// can't just use SW_SHOWDEFAULT, because that is set on a per-process
// basis. That means that a second window needs to have its STARTUPINFO's
// wShowCmd passed into the original process.
auto nCmdShow = _launchShowWindowCommand;
if (WI_IsFlagSet(_launchMode, LaunchMode::MaximizedMode))
{
nCmdShow = SW_MAXIMIZE;

View File

@@ -43,6 +43,8 @@ private:
std::shared_ptr<ThrottledFuncTrailing<bool>> _showHideWindowThrottler;
uint32_t _launchShowWindowCommand{ SW_NORMAL };
void _preInit();
void _HandleCommandlineArgs(const winrt::Microsoft::Terminal::Remoting::WindowRequestedArgs& args);

View File

@@ -73,7 +73,15 @@ bool WindowEmperor::HandleCommandlineArgs()
_buildArgsFromCommandline(args);
auto cwd{ wil::GetCurrentDirectoryW<std::wstring>() };
Remoting::CommandlineArgs eventArgs{ { args }, { cwd } };
// Get the requested initial state of the window from our startup info. For
// something like `start /min`, this will set the wShowWindow member to
// SW_SHOWMINIMIZED. We'll need to make sure is bubbled all the way through,
// so we can open a new window with the same state.
STARTUPINFOW si;
GetStartupInfoW(&si);
const auto showWindow = si.wShowWindow;
Remoting::CommandlineArgs eventArgs{ { args }, { cwd }, showWindow };
const auto isolatedMode{ _app.Logic().IsolatedMode() };