Skip to content

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

@zadjii-msft

Description

@zadjii-msft

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-CmdPalCommand Palette issues and featuresArea-UserInterfaceIssues pertaining to the user interface of the Console or TerminalIssue-TaskIt's a feature request, but it doesn't really need a major design.Priority-2A description (P2)Product-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions