Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using tab in GitHub Copilot doesn't trigger the inline suggestion - macOS Visual Studio Code

I am a new user of GitHub Copilot and I am having trouble triggering the in-line suggestions it provides. I have tried various settings and configurations, but I am still unable to get it to work properly.

The expected output is that I should be able to accept copilot inline suggestions by pressing tab, enter, or space.

I have taken several steps to try and resolve the issue.

  1. I made sure that I am using the most recent version of Visual Studio Code, which is currently 1.78.2.
  2. I ensured that my machine is updated to Mac Air M1 13.3.1.
  3. I installed the latest version of GitHub Copilot, which is currently v1.86.82.

I have also checked and updated my VS Code settings to include the following:

"[copilotignore]": {
    "editor.acceptSuggestionOnCommitCharacter": true,
    "editor.acceptSuggestionOnEnter": "smart"
  },

  "github.copilot.advanced": {
    // "secret_key": "",
    "useTab": true
  },
  "github.copilot.editor.enableAutoCompletions": true,
  "emmet.showSuggestionsAsSnippets": true,
  "github.copilot.enable": {
    "*": true,
    "plaintext": true,
    "markdown": true,
    "scminput": true,
    "javascript": true
  },
  "editor.acceptSuggestionOnEnter": "smart",
  "extensions.autoCheckUpdates": true,

Any ideas what's going on here? enter image description here

like image 209
Omar Avatar asked Jul 11 '26 09:07

Omar


2 Answers

I also encountered this issue, and I solved it using the following method:

To enable GitHub Copilot suggestions with the Tab key, do the following:

1.Open the keybindings.json file in Visual Studio Code. You can do this by pressing Ctrl + Shift + P and typing Open Keyboard Shortcuts (JSON).

2.In the keybindings.json file, add the following code:

[
  {
    "key": "tab",
    "command": "editor.action.inlineSuggest.commit",
    "when": "textInputFocus && inlineSuggestionHasIndentationLessThanTabSize && inlineSuggestionVisible && !editorTabMovesFocus"     
  }
]

This will enable you to accept Markdown suggestions with the Tab key!

like image 91
yanhaijing Avatar answered Jul 13 '26 15:07

yanhaijing


Just wanted to drop in, that there is also a command called Toggle Tab moves Focus. I toggled it off and then I was able to use my Tab key to accept suggestions from Copilot again. Before every time I hit Tab I was apperantly just loosing focus... 🙈

In the following screenshot you see my Show All Commands which I open via Ctrl + Shift + P.

Showing that I recently used

like image 32
inTheFlow Avatar answered Jul 13 '26 15:07

inTheFlow