Skip to content

Commit dd348dc

Browse files
authored
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
1 parent 0dedb93 commit dd348dc

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
@@ -933,6 +933,10 @@ namespace winrt::TerminalApp::implementation
933933
ParsedCommandLineText(L"");
934934
_searchBox().Text(L"");
935935
_searchBox().Select(_searchBox().Text().size(), 0);
936+
937+
_nestedActionStack.Clear();
938+
ParentCommandName(L"");
939+
_currentNestedCommands.Clear();
936940
// Leaving this block of code outside the above if-statement
937941
// guarantees that the correct text is shown for the mode
938942
// whenever _switchToMode is called.

0 commit comments

Comments
 (0)