microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.05k stars 29.23k forks source link

Terminal chat cmd/alt+enter doesn't work on mac #232966

Open Tyriar opened 2 days ago

Tyriar commented 2 days ago

cmd/alt+enter doesn't work in this state on mac:

Image

cmd+enter:

2024-11-04 05:11:44.840 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-11-04 05:11:44.841 [info] [KeybindingService]: \ Keyboard event cannot be dispatched
2024-11-04 05:11:44.841 [info] [KeybindingService]: / Received  keydown event - modifiers: [meta], code: MetaLeft, keyCode: 91, key: Meta
2024-11-04 05:11:44.841 [info] [KeybindingService]: | Converted keydown event - modifiers: [meta], code: MetaLeft, keyCode: 57 ('Meta')
2024-11-04 05:11:44.841 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
2024-11-04 05:11:44.962 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-11-04 05:11:44.962 [info] [KeybindingService]: | Resolving meta+[Enter]
2024-11-04 05:11:44.963 [info] [KeybindingService]: \ From 23 keybinding entries, no when clauses matched the context.
2024-11-04 05:11:44.977 [info] [KeybindingService]: / Received  keydown event - modifiers: [meta], code: Enter, keyCode: 13, key: Enter
2024-11-04 05:11:44.977 [info] [KeybindingService]: | Converted keydown event - modifiers: [meta], code: Enter, keyCode: 3 ('Enter')
2024-11-04 05:11:44.978 [info] [KeybindingService]: | Resolving meta+[Enter]
2024-11-04 05:11:44.978 [info] [KeybindingService]: \ From 23 keybinding entries, no when clauses matched the context.
2024-11-04 05:11:45.180 [info] [KeybindingService]: + Storing single modifier for possible chord meta.
2024-11-04 05:11:45.482 [info] [KeybindingService]: + Clearing single modifier due to 300ms elapsed.

alt+enter:

2024-11-04 05:12:01.051 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-11-04 05:12:01.051 [info] [KeybindingService]: \ Keyboard event cannot be dispatched
2024-11-04 05:12:01.052 [info] [KeybindingService]: / Received  keydown event - modifiers: [alt], code: AltLeft, keyCode: 18, key: Alt
2024-11-04 05:12:01.052 [info] [KeybindingService]: | Converted keydown event - modifiers: [alt], code: AltLeft, keyCode: 6 ('Alt')
2024-11-04 05:12:01.052 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
2024-11-04 05:12:01.156 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-11-04 05:12:01.170 [info] [KeybindingService]: | Resolving alt+[Enter]
2024-11-04 05:12:01.170 [info] [KeybindingService]: \ From 8 keybinding entries, no when clauses matched the context.
2024-11-04 05:12:01.170 [info] [KeybindingService]: / Received  keydown event - modifiers: [alt], code: Enter, keyCode: 13, key: Enter
2024-11-04 05:12:01.170 [info] [KeybindingService]: | Converted keydown event - modifiers: [alt], code: Enter, keyCode: 3 ('Enter')
2024-11-04 05:12:01.170 [info] [KeybindingService]: | Resolving alt+[Enter]
2024-11-04 05:12:01.170 [info] [KeybindingService]: \ From 8 keybinding entries, no when clauses matched the context.
2024-11-04 05:12:01.358 [info] [KeybindingService]: + Ignoring single modifier alt due to it being pressed together with other keys.
Tyriar commented 2 days ago

We're not returning the right object here anymore, it's calling ChatWidget.acceptInput

https://github.com/microsoft/vscode/blob/e37672f7d7a7e55064cad4d0b11e88f8d92ba7ac/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.ts#L70-L72

Probably caused by https://github.com/microsoft/vscode/pull/232278 cc @meganrogge

Tyriar commented 2 days ago

@meganrogge could you check this one out as you have more context?

This is not being called which is causing the codeblock context keys never to get set:

https://github.com/microsoft/vscode/blob/e37672f7d7a7e55064cad4d0b11e88f8d92ba7ac/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.ts#L363

Should we be listening to this._inlineChatWidget.chatWidget.onDidAcceptInput as the hook maybe?

meganrogge commented 9 hours ago

I don't see our execute actions anymore - Run and Insert