diff --git a/src/vs/sessions/contrib/chat/browser/chat.contribution.ts b/src/vs/sessions/contrib/chat/browser/chat.contribution.ts index 960b5b63cb0..f39bb24fb41 100644 --- a/src/vs/sessions/contrib/chat/browser/chat.contribution.ts +++ b/src/vs/sessions/contrib/chat/browser/chat.contribution.ts @@ -48,6 +48,7 @@ class NewChatInSessionsWindowAction extends Action2 { id: NEW_SESSION_ACTION_ID, title: localize2('chat.newEdits.label', "New Chat"), category: CHAT_CATEGORY, + f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib + 2, // Don't shadow Ctrl/Cmd+N (and Ctrl/Cmd+L) when focus is in the diff --git a/test/automation/src/agentsWindow.ts b/test/automation/src/agentsWindow.ts index 8f4d6317996..6d97bf69823 100644 --- a/test/automation/src/agentsWindow.ts +++ b/test/automation/src/agentsWindow.ts @@ -36,14 +36,15 @@ export class AgentsWindow { } /** - * Start a new session from inside the Agents Window via the - * `workbench.action.sessions.newChat` keybinding (Ctrl+L). The action - * is not exposed in the command palette, so we drive it through its - * key chord which works cross-platform (mac uses WinCtrl+L as the - * secondary binding, which maps to plain Ctrl+L). + * Start a new session from inside the Agents Window by executing + * `workbench.action.sessions.newChat` via the command palette. We + * avoid a raw keybinding dispatch because the action's Ctrl+L + * binding is gated on `!editorAreaFocus`, which is false after + * interacting with the chat editor. */ async startNewSession(): Promise { - await this.code.dispatchKeybinding('ctrl+l', async () => this.waitForNewSessionView()); + await this.quickaccess.runCommand('workbench.action.sessions.newChat'); + await this.waitForNewSessionView(); } /**