Skip to content

Commit afd6a87

Browse files
kovduDHowett
authored andcommitted
Clear all state tracking nested commands when switching command mode (#10164)
Went for option 2 proposed here: #10140 (comment). Disabling back space in the nested entry didn't felt as the nicest solution. Instead now all state that keeps track of nested commands is cleared when switching beteen modes. ## Validation Steps Performed - Validated the specified issue is fixed by this change:. now after entering a sub command and hitting backspace the palette no longer shows the sub command item (here `< Select color scheme...` ). - Validated that switching between all modes (command line, actions, tab search & tab switch) still work as expected. - Validated as well that all modes still work as expected. Didn't add unit tests, but happy to try that out if this would be required. Closes #10140 (cherry picked from commit dd348dc)
1 parent a3de0d0 commit afd6a87

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cascadia/TerminalApp/CommandPalette.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,10 @@ namespace winrt::TerminalApp::implementation
927927
ParsedCommandLineText(L"");
928928
_searchBox().Text(L"");
929929
_searchBox().Select(_searchBox().Text().size(), 0);
930+
931+
_nestedActionStack.Clear();
932+
ParentCommandName(L"");
933+
_currentNestedCommands.Clear();
930934
// Leaving this block of code outside the above if-statement
931935
// guarantees that the correct text is shown for the mode
932936
// whenever _switchToMode is called.

0 commit comments

Comments
 (0)