From 419564320e12e13f8af7cabf4a9dc3a20ee32ce0 Mon Sep 17 00:00:00 2001 From: Isaac Blanco <40709873+AlejandroBlanco2001@users.noreply.github.com> Date: Sun, 10 Mar 2024 17:06:23 -0500 Subject: [PATCH 1/4] Update CommandPalette.cpp to ignore _filterTextChanged on TabSwitchMode --- src/cascadia/TerminalApp/CommandPalette.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cascadia/TerminalApp/CommandPalette.cpp b/src/cascadia/TerminalApp/CommandPalette.cpp index dfba90a40ae..afbfa2008dd 100644 --- a/src/cascadia/TerminalApp/CommandPalette.cpp +++ b/src/cascadia/TerminalApp/CommandPalette.cpp @@ -843,6 +843,16 @@ namespace winrt::TerminalApp::implementation void CommandPalette::_filterTextChanged(const IInspectable& /*sender*/, const Windows::UI::Xaml::RoutedEventArgs& /*args*/) { + // When we are executing the _SelectNextTab in the TabManagement.cpp, this method + // is getting triggered because we set up the default value for that CommandPallete + // with an empty string. Therefore, to avoid the reset of the index when executing + // the Next/Prev tab command, we are skiping this execution. + // Check issue https://github.com/microsoft/terminal/issues/11146 + if (_currentMode == CommandPaletteMode::TabSwitchMode) + { + return; + } + if (_currentMode == CommandPaletteMode::CommandlineMode) { _evaluatePrefix(); From 160700e4a2da75e393d15507843442650b2152e2 Mon Sep 17 00:00:00 2001 From: Isaac Blanco <40709873+AlejandroBlanco2001@users.noreply.github.com> Date: Sun, 10 Mar 2024 20:26:48 -0500 Subject: [PATCH 2/4] Fixing spelling issues --- src/cascadia/TerminalApp/CommandPalette.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cascadia/TerminalApp/CommandPalette.cpp b/src/cascadia/TerminalApp/CommandPalette.cpp index afbfa2008dd..841147ad830 100644 --- a/src/cascadia/TerminalApp/CommandPalette.cpp +++ b/src/cascadia/TerminalApp/CommandPalette.cpp @@ -844,9 +844,9 @@ namespace winrt::TerminalApp::implementation const Windows::UI::Xaml::RoutedEventArgs& /*args*/) { // When we are executing the _SelectNextTab in the TabManagement.cpp, this method - // is getting triggered because we set up the default value for that CommandPallete + // is getting triggered because we set up the default value for that CommandPalete // with an empty string. Therefore, to avoid the reset of the index when executing - // the Next/Prev tab command, we are skiping this execution. + // the Next/Prev tab command, we are skipping this execution. // Check issue https://github.com/microsoft/terminal/issues/11146 if (_currentMode == CommandPaletteMode::TabSwitchMode) { From 696cb2758bed41b619e99c169c686ce267486e92 Mon Sep 17 00:00:00 2001 From: Isaac Blanco <40709873+AlejandroBlanco2001@users.noreply.github.com> Date: Sun, 10 Mar 2024 20:35:19 -0500 Subject: [PATCH 3/4] Fixing spelling issues again --- src/cascadia/TerminalApp/CommandPalette.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/CommandPalette.cpp b/src/cascadia/TerminalApp/CommandPalette.cpp index 841147ad830..59221d7195d 100644 --- a/src/cascadia/TerminalApp/CommandPalette.cpp +++ b/src/cascadia/TerminalApp/CommandPalette.cpp @@ -844,7 +844,7 @@ namespace winrt::TerminalApp::implementation const Windows::UI::Xaml::RoutedEventArgs& /*args*/) { // When we are executing the _SelectNextTab in the TabManagement.cpp, this method - // is getting triggered because we set up the default value for that CommandPalete + // is getting triggered because we set up the default value for that CommandPalette // with an empty string. Therefore, to avoid the reset of the index when executing // the Next/Prev tab command, we are skipping this execution. // Check issue https://github.com/microsoft/terminal/issues/11146 From 015625dcaa6f5a5e64ab2afb3c7cb5855714f69f Mon Sep 17 00:00:00 2001 From: Isaac Blanco Date: Sun, 10 Mar 2024 21:30:34 -0500 Subject: [PATCH 4/4] Fixing formatting --- src/cascadia/TerminalApp/CommandPalette.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/CommandPalette.cpp b/src/cascadia/TerminalApp/CommandPalette.cpp index 59221d7195d..81921210c29 100644 --- a/src/cascadia/TerminalApp/CommandPalette.cpp +++ b/src/cascadia/TerminalApp/CommandPalette.cpp @@ -852,7 +852,7 @@ namespace winrt::TerminalApp::implementation { return; } - + if (_currentMode == CommandPaletteMode::CommandlineMode) { _evaluatePrefix();