From 79b01c410c433e6ced8f03f0b4c5f4c0a18bba1e Mon Sep 17 00:00:00 2001 From: meganrogge Date: Mon, 1 Apr 2024 11:12:14 -0700 Subject: [PATCH 1/4] get insert kb to work in input editor --- .../chat/browser/terminalChatActions.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts index 7f1869b6525..56937274aef 100644 --- a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts +++ b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts @@ -224,11 +224,16 @@ registerActiveXtermAction({ TerminalChatContextKeys.responseContainsCodeBlock, TerminalChatContextKeys.responseContainsMultipleCodeBlocks.negate() ), - keybinding: { + keybinding: [{ when: TerminalChatContextKeys.requestActive.negate(), weight: KeybindingWeight.WorkbenchContrib, primary: KeyMod.Alt | KeyCode.Enter, }, + { + when: ContextKeyExpr.and(TerminalChatContextKeys.focused, CTX_INLINE_CHAT_FOCUSED), + weight: KeybindingWeight.WorkbenchContrib, + primary: KeyMod.CtrlCmd | KeyCode.Enter | KeyMod.Alt + }], menu: { id: MENU_TERMINAL_CHAT_WIDGET_STATUS, group: '0_main', @@ -255,11 +260,16 @@ registerActiveXtermAction({ TerminalChatContextKeys.agentRegistered, TerminalChatContextKeys.responseContainsMultipleCodeBlocks ), - keybinding: { + keybinding: [{ when: TerminalChatContextKeys.requestActive.negate(), weight: KeybindingWeight.WorkbenchContrib, primary: KeyMod.Alt | KeyCode.Enter, - }, + secondary: [KeyMod.CtrlCmd | KeyCode.Enter | KeyMod.Alt] + }, { + when: ContextKeyExpr.and(TerminalChatContextKeys.focused, CTX_INLINE_CHAT_FOCUSED), + weight: KeybindingWeight.WorkbenchContrib, + primary: KeyMod.CtrlCmd | KeyCode.Enter | KeyMod.Alt + }], menu: { id: MENU_TERMINAL_CHAT_WIDGET_STATUS, group: '0_main', From 563b84c085ee17ac45c3d7b8c3bc6ce0d8687c79 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Mon, 1 Apr 2024 11:18:35 -0700 Subject: [PATCH 2/4] just add as secondary --- .../chat/browser/terminalChatActions.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts index 56937274aef..30118ad1f19 100644 --- a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts +++ b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts @@ -224,16 +224,12 @@ registerActiveXtermAction({ TerminalChatContextKeys.responseContainsCodeBlock, TerminalChatContextKeys.responseContainsMultipleCodeBlocks.negate() ), - keybinding: [{ + keybinding: { when: TerminalChatContextKeys.requestActive.negate(), weight: KeybindingWeight.WorkbenchContrib, primary: KeyMod.Alt | KeyCode.Enter, + secondary: [KeyMod.CtrlCmd | KeyCode.Enter | KeyMod.Alt] }, - { - when: ContextKeyExpr.and(TerminalChatContextKeys.focused, CTX_INLINE_CHAT_FOCUSED), - weight: KeybindingWeight.WorkbenchContrib, - primary: KeyMod.CtrlCmd | KeyCode.Enter | KeyMod.Alt - }], menu: { id: MENU_TERMINAL_CHAT_WIDGET_STATUS, group: '0_main', @@ -265,10 +261,6 @@ registerActiveXtermAction({ weight: KeybindingWeight.WorkbenchContrib, primary: KeyMod.Alt | KeyCode.Enter, secondary: [KeyMod.CtrlCmd | KeyCode.Enter | KeyMod.Alt] - }, { - when: ContextKeyExpr.and(TerminalChatContextKeys.focused, CTX_INLINE_CHAT_FOCUSED), - weight: KeybindingWeight.WorkbenchContrib, - primary: KeyMod.CtrlCmd | KeyCode.Enter | KeyMod.Alt }], menu: { id: MENU_TERMINAL_CHAT_WIDGET_STATUS, From d50528e3c41a9c22d44be2219882266e1ef80ac8 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Mon, 1 Apr 2024 11:20:12 -0700 Subject: [PATCH 3/4] Update src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts --- .../contrib/terminalContrib/chat/browser/terminalChatActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts index 30118ad1f19..ae38c3a1562 100644 --- a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts +++ b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts @@ -256,7 +256,7 @@ registerActiveXtermAction({ TerminalChatContextKeys.agentRegistered, TerminalChatContextKeys.responseContainsMultipleCodeBlocks ), - keybinding: [{ + keybinding: { when: TerminalChatContextKeys.requestActive.negate(), weight: KeybindingWeight.WorkbenchContrib, primary: KeyMod.Alt | KeyCode.Enter, From 7b73cfd296a43b4fe203bab3294e0658925d2b28 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Mon, 1 Apr 2024 11:20:27 -0700 Subject: [PATCH 4/4] Update src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts --- .../contrib/terminalContrib/chat/browser/terminalChatActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts index ae38c3a1562..57428543945 100644 --- a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts +++ b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts @@ -261,7 +261,7 @@ registerActiveXtermAction({ weight: KeybindingWeight.WorkbenchContrib, primary: KeyMod.Alt | KeyCode.Enter, secondary: [KeyMod.CtrlCmd | KeyCode.Enter | KeyMod.Alt] - }], + }, menu: { id: MENU_TERMINAL_CHAT_WIDGET_STATUS, group: '0_main',