Is there a shortcut to focus to the GitHub Copilot Chat panel in VSCode?
Asked Answered
F

3

9

I've been extensively using Github Copilot and I'm looking for a convenient keybinding to effortlessly switch between the GitHub Copilot Chat panel and my code editor. I've experimented with various keybinding configurations, but unfortunately, none of them seem to be effective in achieving this task.

Formyl answered 28/1, 2024 at 23:35 Comment(0)
B
5

marius-mihail's answer worked for quick chat, but not the chat panel for me (I'm on macOS, not sure if related), so I udated it to toggle between editor and chat panel (opening the later if needed):

    {
        "key": "ctrl+alt+cmd+c",
        "command": "workbench.panel.chat.view.copilot.focus",
        "when": "editorFocus"
    },
    {
        // Move focus back to the Editor
        "key": "ctrl+alt+cmd+c",
        "command": "workbench.action.focusActiveEditorGroup",
        "when": "!editorFocus"
    }
Brussels answered 13/2, 2024 at 15:19 Comment(0)
F
3

EDIT: I've found a way

Add this to your keybindings.json file:

  {
    // Move focus to the GitHub Copilot Chat panel
    "key": "ctrl+0",
    "command": "workbench.panel.chat.view.copilot.focus",
    "when": "!inEditorsPicker && !inQuickOpen"
  },
  {
    // Move focus back to the Editor
    "key": "ctrl+0",
    "command": "workbench.action.focusActiveEditorGroup",
    "when": "inEditorsPicker || inQuickOpen"
  }
Formyl answered 28/1, 2024 at 23:38 Comment(1)
fyi: ctrl+0 is the default keybinding for focusing the primary sidebar and whatever view container is currently active in it.Camel
L
0

It seems that there is already a built-in shortcut out of the box for Github Copilot in VS Code:

Mac: Ctrl + Cmd + I ⌃⌘I

Windows: Ctrl+I ⌃I

Source: https://code.visualstudio.com/docs/copilot/getting-started-chat

Lock answered 3/9, 2024 at 11:51 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.