commandPalette keybinding should close the palette when it's open #9272

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

Originally created by @zadjii-msft on GitHub (Jun 25, 2020).

This is being moved from discussion in #6635.

We wanted to enable the commandPalette keybinding to also work within the palette itself.

carlos-zamora

I know I suggested this, but it unveiled a huge problem. When paste is bound to ctrl+v, we paste to the underlying terminal twice. A similarly weird problem occurs with copy.

Maybe we should only detect the commandPalette action and use that as an additional way to dismiss it.

DHowett

Don't we just need to mark it Handled here? lol

zadjii-msft

This is shockingly bad actually.

  • If we just mark it as Handled(true), then the following KeyUp will still land in the TermControl, resulting in ^VPasted Text being written to the Terminal.
  • If we change the keybinding handler to on KeyUp, then it's likely that the first keyup it'll see is the keybinding for toggle the palette, which will immediately close it.

I'm going to move this to a follow-up issue, to get at the least the toggle the command palette action back, and maybe the full keybindings

[3:29 PM] Mike Griese
I'll file a follow-up - maybe we could do something where the action is selected on the keydown, but then only dispatched on the keyup?
​> [3:30 PM] Mike Griese
so we'll only try a keybinding on a keyup after a non-modifier keydown

Originally created by @zadjii-msft on GitHub (Jun 25, 2020). This is being moved from discussion in #6635. We wanted to enable the `commandPalette` keybinding to also work within the palette itself. carlos-zamora > I know I suggested this, but it unveiled a huge problem. When paste is bound to ctrl+v, we paste to the underlying terminal twice. A similarly weird problem occurs with copy. > > Maybe we should only detect the commandPalette action and use that as an additional way to dismiss it. DHowett > Don't we just need to mark it Handled here? lol zadjii-msft > This is shockingly bad actually. > > * If we just mark it as Handled(true), then the following KeyUp will still land in the TermControl, resulting in ^VPasted Text being written to the Terminal. > * If we change the keybinding handler to on KeyUp, then it's likely that the first keyup it'll see is the keybinding for toggle the palette, which will immediately close it. > > I'm going to move this to a follow-up issue, to get at the least the toggle the command palette action back, and maybe the full keybindings > [3:29 PM] Mike Griese > I'll file a follow-up - maybe we could do something where the action is selected on the keydown, but then only dispatched on the keyup? ​> [3:30 PM] Mike Griese > so we'll only try a keybinding on a keyup after a non-modifier keydown
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9272