[PR #8250] 8247: Custom key bindings are broken for tab navigation #27154

Open
opened 2026-01-31 09:20:19 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/8250

State: closed
Merged: Yes


There are two code paths for Ctrl+Tab and for everything else:

Ctrl + Tab is working perfectly

  • On the first tab navigation TerminalPage::_SelectNextTab resets the
    tab commands, and since palette is not visible selects the relevant
    tab index
  • On the second navigation Ctrl+Tab is intercepted by
    CommandPalette::_previewKeyDownHandler and everything works fine

But with custom binding things are screwed:

  • On the first tab navigation TerminalPage::_SelectNextTab resets the
    tab commands, and since palette is not visible selects the relevant
    tab index
  • On the second navigation keys are not intercepted and thus
    TerminalPage::_SelectNextTab is called again. It resets the commands,
    but now since the palette is visible we simply invoke
    CommandPalette::SelectNextItem. Which in turn misbehaves because no
    item is selected.

The approach for the solution is not to reset anything if the command
palette is already open.

Validation Steps Performed

  • Manual testing of both custom and non-custom bindings with different
    amount of tabs.

Closes #8247

**Original Pull Request:** https://github.com/microsoft/terminal/pull/8250 **State:** closed **Merged:** Yes --- There are two code paths for Ctrl+Tab and for everything else: Ctrl + Tab is working perfectly * On the first tab navigation TerminalPage::_SelectNextTab resets the tab commands, and since palette is not visible selects the relevant tab index * On the second navigation Ctrl+Tab is intercepted by CommandPalette::_previewKeyDownHandler and everything works fine But with custom binding things are screwed: * On the first tab navigation TerminalPage::_SelectNextTab resets the tab commands, and since palette is not visible selects the relevant tab index * On the second navigation keys are not intercepted and thus TerminalPage::_SelectNextTab is called again. It resets the commands, but now since the palette is visible we simply invoke CommandPalette::SelectNextItem. Which in turn misbehaves because no item is selected. The approach for the solution is not to reset anything if the command palette is already open. ## Validation Steps Performed * Manual testing of both custom and non-custom bindings with different amount of tabs. Closes #8247
claunia added the pull-request label 2026-01-31 09:20:19 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27154