From 69112d16f47c3bb130e65531304bee0455b529b0 Mon Sep 17 00:00:00 2001 From: FernandoAscencio Date: Tue, 25 Apr 2023 17:00:29 -0400 Subject: [PATCH] quick-open: `Esc` closes inputbox when focus out. Closes: 6773 Signed-Off-By: FernandoAscencio --- .../quick-input/quick-command-frontend-contribution.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/core/src/browser/quick-input/quick-command-frontend-contribution.ts b/packages/core/src/browser/quick-input/quick-command-frontend-contribution.ts index d825b3dfd44c4..c02f00505289e 100644 --- a/packages/core/src/browser/quick-input/quick-command-frontend-contribution.ts +++ b/packages/core/src/browser/quick-input/quick-command-frontend-contribution.ts @@ -38,6 +38,11 @@ export class QuickCommandFrontendContribution implements CommandContribution, Ke commands.registerCommand(CLEAR_COMMAND_HISTORY, { execute: () => commands.clearCommandHistory(), }); + commands.registerCommand({ id: 'workbench.action.closeQuickOpen' }, { + execute: () => { + this.quickInputService?.hide(); + } + }); } registerMenus(menus: MenuModelRegistry): void { @@ -56,5 +61,10 @@ export class QuickCommandFrontendContribution implements CommandContribution, Ke command: quickCommand.id, keybinding: 'ctrlcmd+shift+p' }); + keybindings.registerKeybinding({ + command: 'workbench.action.closeQuickOpen', + keybinding: 'esc', + when: 'inQuickOpen' + }); } }