From f5b5e33530cfce6bf2df061dcb403ee8af14e97d Mon Sep 17 00:00:00 2001 From: Don-Vito Date: Fri, 9 Oct 2020 17:02:11 +0300 Subject: [PATCH 01/10] 7124: initial commit - add focused and maximizedFocused launch modes. If one of them is set, focusedMode should be toggled on startup --- src/cascadia/TerminalApp/AppLogic.cpp | 4 ++++ src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl | 2 ++ .../TerminalSettingsSerializationHelpers.h | 4 +++- src/cascadia/WindowsTerminal/IslandWindow.cpp | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cascadia/TerminalApp/AppLogic.cpp b/src/cascadia/TerminalApp/AppLogic.cpp index e49b0147b6a..8a6db9a9dbc 100644 --- a/src/cascadia/TerminalApp/AppLogic.cpp +++ b/src/cascadia/TerminalApp/AppLogic.cpp @@ -265,6 +265,10 @@ namespace winrt::TerminalApp::implementation { _root->ToggleFullscreen(); } + else if(launchMode == LaunchMode::FocusedMode || launchMode == LaunchMode::MaximizedFocusedMode) + { + _root->ToggleFocusMode(); + } }); _root->Create(); diff --git a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl index 5a748738719..c536154fc84 100644 --- a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl +++ b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl @@ -22,6 +22,8 @@ namespace Microsoft.Terminal.Settings.Model DefaultMode, MaximizedMode, FullscreenMode, + FocusedMode, + MaximizedFocusedMode, }; [default_interface] runtimeclass GlobalAppSettings { diff --git a/src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h b/src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h index 8f28dbfcfc4..0f813f5f6ec 100644 --- a/src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h +++ b/src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h @@ -165,10 +165,12 @@ JSON_ENUM_MAPPER(::winrt::Windows::UI::Xaml::ElementTheme) JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::LaunchMode) { - JSON_MAPPINGS(3) = { + JSON_MAPPINGS(5) = { pair_type{ "default", ValueType::DefaultMode }, pair_type{ "maximized", ValueType::MaximizedMode }, pair_type{ "fullscreen", ValueType::FullscreenMode }, + pair_type{ "focused", ValueType::FocusedMode }, + pair_type{ "maximizedFocused", ValueType::MaximizedFocusedMode }, }; }; diff --git a/src/cascadia/WindowsTerminal/IslandWindow.cpp b/src/cascadia/WindowsTerminal/IslandWindow.cpp index 4312fb59df8..5303e5329c5 100644 --- a/src/cascadia/WindowsTerminal/IslandWindow.cpp +++ b/src/cascadia/WindowsTerminal/IslandWindow.cpp @@ -139,7 +139,7 @@ void IslandWindow::_HandleCreateWindow(const WPARAM, const LPARAM lParam) noexce } int nCmdShow = SW_SHOW; - if (launchMode == LaunchMode::MaximizedMode) + if (launchMode == LaunchMode::MaximizedMode || launchMode == LaunchMode::MaximizedFocusedMode) { nCmdShow = SW_MAXIMIZE; } From a2d366262496d63f3eed6754c3a37269f04fa24a Mon Sep 17 00:00:00 2001 From: Don-Vito Date: Fri, 9 Oct 2020 17:34:37 +0300 Subject: [PATCH 02/10] 7124: fix code formatting --- src/cascadia/TerminalApp/AppLogic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/AppLogic.cpp b/src/cascadia/TerminalApp/AppLogic.cpp index 8a6db9a9dbc..a49e4935646 100644 --- a/src/cascadia/TerminalApp/AppLogic.cpp +++ b/src/cascadia/TerminalApp/AppLogic.cpp @@ -265,7 +265,7 @@ namespace winrt::TerminalApp::implementation { _root->ToggleFullscreen(); } - else if(launchMode == LaunchMode::FocusedMode || launchMode == LaunchMode::MaximizedFocusedMode) + else if (launchMode == LaunchMode::FocusedMode || launchMode == LaunchMode::MaximizedFocusedMode) { _root->ToggleFocusMode(); } From bb0d3b13ea2b6f39401fb56a0ac0e28e5a5b329f Mon Sep 17 00:00:00 2001 From: Don-Vito Date: Fri, 9 Oct 2020 18:42:00 +0300 Subject: [PATCH 03/10] 7124: rename focused -> focus, both in the settings name and in the code --- src/cascadia/TerminalApp/AppLogic.cpp | 2 +- src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl | 4 ++-- .../TerminalSettingsSerializationHelpers.h | 4 ++-- src/cascadia/WindowsTerminal/IslandWindow.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cascadia/TerminalApp/AppLogic.cpp b/src/cascadia/TerminalApp/AppLogic.cpp index a49e4935646..112387f8676 100644 --- a/src/cascadia/TerminalApp/AppLogic.cpp +++ b/src/cascadia/TerminalApp/AppLogic.cpp @@ -265,7 +265,7 @@ namespace winrt::TerminalApp::implementation { _root->ToggleFullscreen(); } - else if (launchMode == LaunchMode::FocusedMode || launchMode == LaunchMode::MaximizedFocusedMode) + else if (launchMode == LaunchMode::FocusMode || launchMode == LaunchMode::MaximizedFocusMode) { _root->ToggleFocusMode(); } diff --git a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl index c536154fc84..38bd8545d7f 100644 --- a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl +++ b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl @@ -22,8 +22,8 @@ namespace Microsoft.Terminal.Settings.Model DefaultMode, MaximizedMode, FullscreenMode, - FocusedMode, - MaximizedFocusedMode, + FocusMode, + MaximizedFocusMode, }; [default_interface] runtimeclass GlobalAppSettings { diff --git a/src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h b/src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h index 0f813f5f6ec..9564646890b 100644 --- a/src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h +++ b/src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h @@ -169,8 +169,8 @@ JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::LaunchMode) pair_type{ "default", ValueType::DefaultMode }, pair_type{ "maximized", ValueType::MaximizedMode }, pair_type{ "fullscreen", ValueType::FullscreenMode }, - pair_type{ "focused", ValueType::FocusedMode }, - pair_type{ "maximizedFocused", ValueType::MaximizedFocusedMode }, + pair_type{ "focus", ValueType::FocusMode }, + pair_type{ "maximizedFocus", ValueType::MaximizedFocusMode }, }; }; diff --git a/src/cascadia/WindowsTerminal/IslandWindow.cpp b/src/cascadia/WindowsTerminal/IslandWindow.cpp index 5303e5329c5..ebef2bb248a 100644 --- a/src/cascadia/WindowsTerminal/IslandWindow.cpp +++ b/src/cascadia/WindowsTerminal/IslandWindow.cpp @@ -139,7 +139,7 @@ void IslandWindow::_HandleCreateWindow(const WPARAM, const LPARAM lParam) noexce } int nCmdShow = SW_SHOW; - if (launchMode == LaunchMode::MaximizedMode || launchMode == LaunchMode::MaximizedFocusedMode) + if (launchMode == LaunchMode::MaximizedMode || launchMode == LaunchMode::MaximizedFocusMode) { nCmdShow = SW_MAXIMIZE; } From 45c466d0b1d6f5f62f19c90a5ba8e8c65057095d Mon Sep 17 00:00:00 2001 From: Don-Vito Date: Sat, 10 Oct 2020 11:51:36 +0300 Subject: [PATCH 04/10] 7124: add comman line option for launching in focus mode --- .../CommandlineTest.cpp | 76 +++++++++++++++++++ .../TerminalApp/AppCommandlineArgs.cpp | 12 ++- .../Resources/en-US/Resources.resw | 5 +- 3 files changed, 91 insertions(+), 2 deletions(-) diff --git a/src/cascadia/LocalTests_TerminalApp/CommandlineTest.cpp b/src/cascadia/LocalTests_TerminalApp/CommandlineTest.cpp index 897bc4984f2..783d4b08072 100644 --- a/src/cascadia/LocalTests_TerminalApp/CommandlineTest.cpp +++ b/src/cascadia/LocalTests_TerminalApp/CommandlineTest.cpp @@ -57,6 +57,7 @@ namespace TerminalAppLocalTests TEST_METHOD(TestSimpleExecuteCommandlineAction); TEST_METHOD(TestMultipleCommandExecuteCommandlineAction); TEST_METHOD(TestInvalidExecuteCommandlineAction); + TEST_METHOD(TestLaunchMode); private: void _buildCommandlinesHelper(AppCommandlineArgs& appArgs, @@ -1132,4 +1133,79 @@ namespace TerminalAppLocalTests auto actions = implementation::TerminalPage::ConvertExecuteCommandlineToActions(args); VERIFY_ARE_EQUAL(0u, actions.size()); } + + void CommandlineTest::TestLaunchMode() + { + { + AppCommandlineArgs appArgs{}; + std::vector rawCommands{ L"wt.exe" }; + _buildCommandlinesHelper(appArgs, 1u, rawCommands); + + VERIFY_IS_FALSE(appArgs.GetLaunchMode().has_value()); + } + { + AppCommandlineArgs appArgs{}; + std::vector rawCommands{ L"wt.exe", L"-F" }; + _buildCommandlinesHelper(appArgs, 1u, rawCommands); + + VERIFY_IS_TRUE(appArgs.GetLaunchMode().has_value()); + VERIFY_ARE_EQUAL(appArgs.GetLaunchMode().value(), LaunchMode::FullscreenMode); + } + { + AppCommandlineArgs appArgs{}; + std::vector rawCommands{ L"wt.exe", L"--fullscreen" }; + _buildCommandlinesHelper(appArgs, 1u, rawCommands); + + VERIFY_IS_TRUE(appArgs.GetLaunchMode().has_value()); + VERIFY_ARE_EQUAL(appArgs.GetLaunchMode().value(), LaunchMode::FullscreenMode); + } + { + AppCommandlineArgs appArgs{}; + std::vector rawCommands{ L"wt.exe", L"-M" }; + _buildCommandlinesHelper(appArgs, 1u, rawCommands); + + VERIFY_IS_TRUE(appArgs.GetLaunchMode().has_value()); + VERIFY_ARE_EQUAL(appArgs.GetLaunchMode().value(), LaunchMode::MaximizedMode); + } + { + AppCommandlineArgs appArgs{}; + std::vector rawCommands{ L"wt.exe", L"--maximized" }; + _buildCommandlinesHelper(appArgs, 1u, rawCommands); + + VERIFY_IS_TRUE(appArgs.GetLaunchMode().has_value()); + VERIFY_ARE_EQUAL(appArgs.GetLaunchMode().value(), LaunchMode::MaximizedMode); + } + { + AppCommandlineArgs appArgs{}; + std::vector rawCommands{ L"wt.exe", L"-f" }; + _buildCommandlinesHelper(appArgs, 1u, rawCommands); + + VERIFY_IS_TRUE(appArgs.GetLaunchMode().has_value()); + VERIFY_ARE_EQUAL(appArgs.GetLaunchMode().value(), LaunchMode::FocusMode); + } + { + AppCommandlineArgs appArgs{}; + std::vector rawCommands{ L"wt.exe", L"--focus" }; + _buildCommandlinesHelper(appArgs, 1u, rawCommands); + + VERIFY_IS_TRUE(appArgs.GetLaunchMode().has_value()); + VERIFY_ARE_EQUAL(appArgs.GetLaunchMode().value(), LaunchMode::FocusMode); + } + { + AppCommandlineArgs appArgs{}; + std::vector rawCommands{ L"wt.exe", L"-fM" }; + _buildCommandlinesHelper(appArgs, 1u, rawCommands); + + VERIFY_IS_TRUE(appArgs.GetLaunchMode().has_value()); + VERIFY_ARE_EQUAL(appArgs.GetLaunchMode().value(), LaunchMode::MaximizedFocusMode); + } + { + AppCommandlineArgs appArgs{}; + std::vector rawCommands{ L"wt.exe", L"--maximized", L"--focus" }; + _buildCommandlinesHelper(appArgs, 1u, rawCommands); + + VERIFY_IS_TRUE(appArgs.GetLaunchMode().has_value()); + VERIFY_ARE_EQUAL(appArgs.GetLaunchMode().value(), LaunchMode::MaximizedFocusMode); + } + } } diff --git a/src/cascadia/TerminalApp/AppCommandlineArgs.cpp b/src/cascadia/TerminalApp/AppCommandlineArgs.cpp index 5e077a99eeb..1725fc35a32 100644 --- a/src/cascadia/TerminalApp/AppCommandlineArgs.cpp +++ b/src/cascadia/TerminalApp/AppCommandlineArgs.cpp @@ -175,14 +175,24 @@ void AppCommandlineArgs::_buildParser() // -M,--maximized: Maximizes the window on launch // -F,--fullscreen: Fullscreens the window on launch auto maximizedCallback = [this](int64_t /*count*/) { - _launchMode = winrt::Microsoft::Terminal::Settings::Model::LaunchMode::MaximizedMode; + _launchMode = (_launchMode.has_value() && _launchMode.value() == winrt::Microsoft::Terminal::Settings::Model::LaunchMode::FocusMode) ? + winrt::Microsoft::Terminal::Settings::Model::LaunchMode::MaximizedFocusMode : + winrt::Microsoft::Terminal::Settings::Model::LaunchMode::MaximizedMode; }; auto fullscreenCallback = [this](int64_t /*count*/) { _launchMode = winrt::Microsoft::Terminal::Settings::Model::LaunchMode::FullscreenMode; }; + auto focusCallback = [this](int64_t /*count*/) { + _launchMode = (_launchMode.has_value() && _launchMode.value() == winrt::Microsoft::Terminal::Settings::Model::LaunchMode::MaximizedMode) ? + winrt::Microsoft::Terminal::Settings::Model::LaunchMode::MaximizedFocusMode : + winrt::Microsoft::Terminal::Settings::Model::LaunchMode::FocusMode; + }; + auto maximized = _app.add_flag_function("-M,--maximized", maximizedCallback, RS_A(L"CmdMaximizedDesc")); auto fullscreen = _app.add_flag_function("-F,--fullscreen", fullscreenCallback, RS_A(L"CmdFullscreenDesc")); + auto focus = _app.add_flag_function("-f,--focus", focusCallback, RS_A(L"CmdFocusDesc")); maximized->excludes(fullscreen); + focus->excludes(fullscreen); // Subcommands _buildNewTabParser(); diff --git a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw index 7ab24f60555..7a707e1961c 100644 --- a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw +++ b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw @@ -285,6 +285,9 @@ Launch the window in fullscreen mode + + Launch the window in focus mode + Press the button to open a new terminal tab with your default profile. Open the flyout to select which profile you want to open. @@ -454,4 +457,4 @@ Cancel - \ No newline at end of file + From 73a4fe1535e4f01d7aa70925afff0cfa2d5de94c Mon Sep 17 00:00:00 2001 From: Don-Vito Date: Sat, 10 Oct 2020 15:45:14 +0300 Subject: [PATCH 05/10] 7124: add UT for multiple commands --- .../LocalTests_TerminalApp/CommandlineTest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/cascadia/LocalTests_TerminalApp/CommandlineTest.cpp b/src/cascadia/LocalTests_TerminalApp/CommandlineTest.cpp index 783d4b08072..0c9fe6df64e 100644 --- a/src/cascadia/LocalTests_TerminalApp/CommandlineTest.cpp +++ b/src/cascadia/LocalTests_TerminalApp/CommandlineTest.cpp @@ -1204,6 +1204,22 @@ namespace TerminalAppLocalTests std::vector rawCommands{ L"wt.exe", L"--maximized", L"--focus" }; _buildCommandlinesHelper(appArgs, 1u, rawCommands); + VERIFY_IS_TRUE(appArgs.GetLaunchMode().has_value()); + VERIFY_ARE_EQUAL(appArgs.GetLaunchMode().value(), LaunchMode::MaximizedFocusMode); + } + { + AppCommandlineArgs appArgs{}; + std::vector rawCommands{ L"wt.exe", L"--maximized", L"--focus", L"--focus" }; + _buildCommandlinesHelper(appArgs, 1u, rawCommands); + + VERIFY_IS_TRUE(appArgs.GetLaunchMode().has_value()); + VERIFY_ARE_EQUAL(appArgs.GetLaunchMode().value(), LaunchMode::MaximizedFocusMode); + } + { + AppCommandlineArgs appArgs{}; + std::vector rawCommands{ L"wt.exe", L"--maximized", L"--focus", L"--maximized" }; + _buildCommandlinesHelper(appArgs, 1u, rawCommands); + VERIFY_IS_TRUE(appArgs.GetLaunchMode().has_value()); VERIFY_ARE_EQUAL(appArgs.GetLaunchMode().value(), LaunchMode::MaximizedFocusMode); } From cf9016c58fe1c5b78003ea24ceba73ea0b60be4f Mon Sep 17 00:00:00 2001 From: Don-Vito Date: Tue, 13 Oct 2020 09:36:37 +0300 Subject: [PATCH 06/10] 7124: add new launch modes to the schema in doc cascadia --- doc/cascadia/profiles.schema.json | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/cascadia/profiles.schema.json b/doc/cascadia/profiles.schema.json index db7e46cb944..5dd35fcf6ec 100644 --- a/doc/cascadia/profiles.schema.json +++ b/doc/cascadia/profiles.schema.json @@ -543,18 +543,18 @@ }, "initialCols": { "default": 120, - "description": "The number of columns displayed in the window upon first load.", + "description": "The number of columns displayed in the window upon first load. If \"launchMode\" is set to \"maximized\" (or \"maximizedFocus\"), this property is ignored.", "maximum": 999, "minimum": 1, "type": "integer" }, "initialPosition": { "$ref": "#/definitions/Coordinates", - "description": "The position of the top left corner of the window upon first load. On a system with multiple displays, these coordinates are relative to the top left of the primary display. If \"launchMode\" is set to maximized, the window will be maximized on the monitor specified by those coordinates." + "description": "The position of the top left corner of the window upon first load. On a system with multiple displays, these coordinates are relative to the top left of the primary display. If \"launchMode\" is set to \"maximized\" (or \"maximizedFocus\"), the window will be maximized on the monitor specified by those coordinates." }, "initialRows": { "default": 30, - "description": "The number of rows displayed in the window upon first load.", + "description": "The number of rows displayed in the window upon first load. If \"launchMode\" is set to \"maximized\" (or \"maximizedFocus\"), this property is ignored.", "maximum": 999, "minimum": 1, "type": "integer" @@ -566,11 +566,13 @@ }, "launchMode": { "default": "default", - "description": "Defines whether the terminal will launch as maximized, full screen, or in a window.", + "description": "Defines whether the terminal will launch as maximized, full screen, or in a window. Setting this to \"focus\" is equivalent to launching the terminal in the \"default\" mode, but with the focus mode enabled. Similar, setting this to \"maximizedFocus\" will result in lauching the terminal in a maximized window with the focus mode enabled.", "enum": [ "fullscreen", "maximized", - "default" + "default", + "focus", + "maximizedFocus" ], "type": "string" }, From ad03ae0ab889f81b76ed339619e739cd5c9c468a Mon Sep 17 00:00:00 2001 From: Don-Vito Date: Tue, 13 Oct 2020 09:45:54 +0300 Subject: [PATCH 07/10] 7124: add new launch modes to the schema in doc cascadia --- doc/cascadia/profiles.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cascadia/profiles.schema.json b/doc/cascadia/profiles.schema.json index 5dd35fcf6ec..a63cc4363a9 100644 --- a/doc/cascadia/profiles.schema.json +++ b/doc/cascadia/profiles.schema.json @@ -566,7 +566,7 @@ }, "launchMode": { "default": "default", - "description": "Defines whether the terminal will launch as maximized, full screen, or in a window. Setting this to \"focus\" is equivalent to launching the terminal in the \"default\" mode, but with the focus mode enabled. Similar, setting this to \"maximizedFocus\" will result in lauching the terminal in a maximized window with the focus mode enabled.", + "description": "Defines whether the terminal will launch as maximized, full screen, or in a window. Setting this to \"focus\" is equivalent to launching the terminal in the \"default\" mode, but with the focus mode enabled. Similar, setting this to \"maximizedFocus\" will result in launching the terminal in a maximized window with the focus mode enabled.", "enum": [ "fullscreen", "maximized", From 97abb96e634f8a87c34a6a4fb43191b68af9ad5e Mon Sep 17 00:00:00 2001 From: khvitaly Date: Tue, 13 Oct 2020 23:36:31 +0300 Subject: [PATCH 08/10] 7124: remove explicit namespace and add comment the flags in AppCommandLineArgs --- .../TerminalApp/AppCommandlineArgs.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/cascadia/TerminalApp/AppCommandlineArgs.cpp b/src/cascadia/TerminalApp/AppCommandlineArgs.cpp index 1725fc35a32..16d44258404 100644 --- a/src/cascadia/TerminalApp/AppCommandlineArgs.cpp +++ b/src/cascadia/TerminalApp/AppCommandlineArgs.cpp @@ -171,21 +171,23 @@ void AppCommandlineArgs::_buildParser() }; _app.add_flag_function("-v,--version", versionCallback, RS_A(L"CmdVersionDesc")); - // Maximized and Fullscreen flags + // Launch mode related flags // -M,--maximized: Maximizes the window on launch // -F,--fullscreen: Fullscreens the window on launch + // -f,--focus: Sets the terminal into the Focus mode + // While fullscreen ecludes both maximized and focus mode, the user can combine betwen the maximized and focused (-fM) auto maximizedCallback = [this](int64_t /*count*/) { - _launchMode = (_launchMode.has_value() && _launchMode.value() == winrt::Microsoft::Terminal::Settings::Model::LaunchMode::FocusMode) ? - winrt::Microsoft::Terminal::Settings::Model::LaunchMode::MaximizedFocusMode : - winrt::Microsoft::Terminal::Settings::Model::LaunchMode::MaximizedMode; + _launchMode = (_launchMode.has_value() && _launchMode.value() == LaunchMode::FocusMode) ? + LaunchMode::MaximizedFocusMode : + LaunchMode::MaximizedMode; }; auto fullscreenCallback = [this](int64_t /*count*/) { - _launchMode = winrt::Microsoft::Terminal::Settings::Model::LaunchMode::FullscreenMode; + _launchMode = LaunchMode::FullscreenMode; }; auto focusCallback = [this](int64_t /*count*/) { - _launchMode = (_launchMode.has_value() && _launchMode.value() == winrt::Microsoft::Terminal::Settings::Model::LaunchMode::MaximizedMode) ? - winrt::Microsoft::Terminal::Settings::Model::LaunchMode::MaximizedFocusMode : - winrt::Microsoft::Terminal::Settings::Model::LaunchMode::FocusMode; + _launchMode = (_launchMode.has_value() && _launchMode.value() == LaunchMode::MaximizedMode) ? + LaunchMode::MaximizedFocusMode : + LaunchMode::FocusMode; }; auto maximized = _app.add_flag_function("-M,--maximized", maximizedCallback, RS_A(L"CmdMaximizedDesc")); From 1fb5e83e1a0096d0cb08ef8ec4496a6272de0468 Mon Sep 17 00:00:00 2001 From: khvitaly Date: Tue, 13 Oct 2020 23:39:15 +0300 Subject: [PATCH 09/10] 7124: fix typo in a comment --- src/cascadia/TerminalApp/AppCommandlineArgs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/AppCommandlineArgs.cpp b/src/cascadia/TerminalApp/AppCommandlineArgs.cpp index 16d44258404..1a4c84c86fe 100644 --- a/src/cascadia/TerminalApp/AppCommandlineArgs.cpp +++ b/src/cascadia/TerminalApp/AppCommandlineArgs.cpp @@ -175,7 +175,7 @@ void AppCommandlineArgs::_buildParser() // -M,--maximized: Maximizes the window on launch // -F,--fullscreen: Fullscreens the window on launch // -f,--focus: Sets the terminal into the Focus mode - // While fullscreen ecludes both maximized and focus mode, the user can combine betwen the maximized and focused (-fM) + // While fullscreen excludes both maximized and focus mode, the user can combine betwen the maximized and focused (-fM) auto maximizedCallback = [this](int64_t /*count*/) { _launchMode = (_launchMode.has_value() && _launchMode.value() == LaunchMode::FocusMode) ? LaunchMode::MaximizedFocusMode : From bf1f23b2e71a4682768158490eef1820e2e59372 Mon Sep 17 00:00:00 2001 From: khvitaly Date: Tue, 13 Oct 2020 23:42:12 +0300 Subject: [PATCH 10/10] 7124: fix another typo in a comment --- src/cascadia/TerminalApp/AppCommandlineArgs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/AppCommandlineArgs.cpp b/src/cascadia/TerminalApp/AppCommandlineArgs.cpp index 1a4c84c86fe..413956a0aa0 100644 --- a/src/cascadia/TerminalApp/AppCommandlineArgs.cpp +++ b/src/cascadia/TerminalApp/AppCommandlineArgs.cpp @@ -175,7 +175,7 @@ void AppCommandlineArgs::_buildParser() // -M,--maximized: Maximizes the window on launch // -F,--fullscreen: Fullscreens the window on launch // -f,--focus: Sets the terminal into the Focus mode - // While fullscreen excludes both maximized and focus mode, the user can combine betwen the maximized and focused (-fM) + // While fullscreen excludes both maximized and focus mode, the user can combine between the maximized and focused (-fM) auto maximizedCallback = [this](int64_t /*count*/) { _launchMode = (_launchMode.has_value() && _launchMode.value() == LaunchMode::FocusMode) ? LaunchMode::MaximizedFocusMode :