You want to ask GitHub Copilot a question or request a code change without leaving your editor. The Inline Chat feature lets you do exactly that — start a conversation with Copilot directly in the VS Code editor. This article explains how to open Inline Chat, write effective prompts, and apply suggested changes. You will learn the keyboard shortcuts, the difference between Inline Chat and the Copilot Chat panel, and how to refine responses iteratively.
Key Takeaways: GitHub Copilot Inline Chat in VS Code
- Ctrl+I (Windows/Linux) or Cmd+I (macOS): Opens Inline Chat at the cursor position so you can ask questions or request code changes.
- Slash commands like /fix, /doc, /explain: Perform specific actions such as fixing errors, generating documentation, or explaining selected code.
- Alt+Enter or the Apply button: Inserts Copilot’s suggested code directly into your file without manual copy-paste.
What Is GitHub Copilot Inline Chat and How Does It Work
GitHub Copilot Inline Chat is a feature inside Visual Studio Code that lets you chat with Copilot without opening a separate panel. You press a keyboard shortcut, and a small text box appears at your cursor. You type a question or command, and Copilot responds with code or explanations in the same inline view.
The feature works with the GitHub Copilot extension version 1.86 or later. You need an active GitHub Copilot subscription — either the Free tier with limited monthly completions or a paid plan. Inline Chat uses the same AI model as the Copilot Chat panel but keeps the conversation inside the editor so you never lose context.
Inline Chat is context-aware. It reads the file you are editing, the selected code, and the language of the current file. When you ask a question, Copilot considers all of this to give a relevant answer. You can also reference other open files or the terminal output by using the # symbol followed by a file name or terminal name.
How to Open and Use Inline Chat in VS Code
Follow these steps to start using Inline Chat in your daily workflow.
- Open a file in VS Code
Make sure the file you want to edit is the active tab. Inline Chat reads context from this file. - Press Ctrl+I on Windows/Linux or Cmd+I on macOS
A small text input box appears at your cursor position. If you selected a block of code, Inline Chat opens with that selection as context. - Type your prompt or command
Type a question like “Add error handling to this function” or use a slash command such as/fixto fix issues in the selected code. Press Enter to send the prompt. - Review Copilot’s response
Copilot shows a diff view or a code block in the inline interface. You can scroll through the response and see exactly what changed. - Apply or reject the change
Press Alt+Enter or click the Apply button to insert the suggested code into your file. Press Escape or click the X button to dismiss the suggestion without applying it.
Using Slash Commands in Inline Chat
Slash commands let you perform specific actions quickly. Type / followed by the command name in the Inline Chat input box.
- /fix — Attempts to fix errors in the selected code.
- /doc — Generates documentation comments for the selected function or class.
- /explain — Explains the selected code in plain English.
- /tests — Creates unit tests for the selected function.
- /clear — Clears the current Inline Chat conversation.
Iterating on a Response
After Copilot gives a first suggestion, you can ask follow-up questions in the same Inline Chat box. For example, type “Make it async” or “Use a different library” to refine the output. Each new prompt builds on the previous conversation, so you can narrow down the result without starting over.
Common Mistakes and Limitations of Inline Chat
Inline Chat Does Not Open
If pressing Ctrl+I or Cmd+I does nothing, check that the GitHub Copilot extension is installed and enabled. Open the Extensions view (Ctrl+Shift+X), search for GitHub Copilot, and verify it shows a blue Install or Enable button. Also ensure your VS Code version is 1.86 or later. You can check your version from Help > About.
Copilot Gives Irrelevant Suggestions
Inline Chat relies on the context of the current file and any selected code. If you ask a question without selecting relevant code, Copilot may guess the wrong context. Select the function or block you want to modify before opening Inline Chat. You can also reference specific files by typing # followed by the file name, for example #utils.py.
Applying the Suggestion Does Not Work
If pressing Alt+Enter does not insert the code, check whether the file is read-only. Inline Chat cannot modify files that are marked read-only or that are open in a diff view. Save the file or close the diff view and try again.
Inline Chat vs Copilot Chat Panel
The Copilot Chat panel (opened with Ctrl+Shift+I or Cmd+Shift+I) shows a persistent conversation history in a sidebar. Inline Chat is transient — the conversation disappears when you close the input box. Use the panel for long conversations or when you need to refer back to previous answers. Use Inline Chat for quick, single-turn edits where you want to stay in the editor.
| Item | Inline Chat | Copilot Chat Panel |
|---|---|---|
| Location | Inside the editor at cursor | Sidebar panel |
| Keyboard shortcut | Ctrl+I or Cmd+I | Ctrl+Shift+I or Cmd+Shift+I |
| Conversation history | Lost when closed | Persists in the panel |
| Best for | Quick edits and single-turn questions | Multi-step discussions and research |
| Context sources | Active file, selection, referenced files | Active file, selection, open editors, terminal |
You now know how to open, use, and troubleshoot GitHub Copilot Inline Chat in VS Code. Start by pressing Ctrl+I or Cmd+I in any code file and try the /fix command on a function that has a syntax error. For deeper multi-step conversations, switch to the Copilot Chat panel with Ctrl+Shift+I or Cmd+Shift+I.