Skip to content

Latest commit

 

History

History
96 lines (55 loc) · 5.86 KB

File metadata and controls

96 lines (55 loc) · 5.86 KB
ContentId e6b33fcb-8240-49dd-b6ca-5412d6fa669a
DateApproved 4/8/2026
MetaDescription Use Inline Chat in Visual Studio Code to make edits directly in the editor or get command suggestions in the terminal.
MetaSocialImage ../images/shared/github-copilot-social.png

Inline chat

With inline chat in Visual Studio Code, you can ask for generating code or making edits directly in the editor or get help with shell commands within the integrated terminal. Inline chat allows you to stay in the flow of your work without having to switch to a separate Chat view.

Use inline chat when you want to make quick, targeted edits within the visible code context. For multi-step tasks, multi-file changes, or broader codebase exploration, use the Chat view instead.

Use editor inline chat

When you use editor inline chat, your prompt is scoped to the code in the active editor. Inline chat might use the content from other files in your workspace as context for your prompt.

To use editor inline chat:

  1. Open a file in the editor.

  2. Open editor inline chat by using the kb(inlinechat.start) keyboard shortcut or by selecting Open Inline Chat from the Chat menu in the title bar.

  3. Type your prompt in the chat input field and press kbstyle(Enter).

    Screenshot showing the inline chat control.

    [!TIP] Select a block of code in the editor to scope the prompt to that code.

  4. VS Code shows a diff with the code suggestion inline in the editor. Use Keep or Undo to accept or reject the changes.

    Screenshot showing editor inline chat suggesting a non-recursive factorial implementation.

Inline chat in active editing sessions

When a file belongs to an active chat editing session, pressing kb(inlinechat.start) opens "Ask in Chat" in the Chat view instead of regular inline chat. This routes your prompt into the existing session so it can use the full conversation context. The editor context menu also shows Ask in Chat instead of Open Inline Chat for these files.

To always use regular inline chat, even for files that belong to a chat session, set setting(inlineChat.askInChat) to false.

On files that don't belong to any chat session, kb(inlinechat.start) always opens regular inline chat, regardless of this setting.

Show a visual hint on text selection (Experimental)

When you select text in the editor, VS Code can display a visual hint to help you start inline chat for the selected code. Use the setting(inlineChat.affordance) setting to control how this hint appears:

  • off: no hint is shown when you select text
  • gutter: the hint appears in the line number area next to your selection
  • editor: the hint appears at the cursor position within your selection, integrated with the lightbulb for code actions

Screenshot showing the inline chat hint in the gutter when text is selected in the editor.

The hint displays an inline chat input box and actions for adding the selection to chat, explaining the code, and starting a code review of the selection.

Note

This feature is experimental and works with the setting(inlineChat.renderMode) setting set to hover.

Use terminal inline chat

You can bring up terminal inline chat in the integrated terminal to get help with shell commands or ask terminal-related questions.

To use terminal inline chat:

  1. Open the terminal in VS Code by selecting the View > Terminal menu item or using the kb(workbench.action.terminal.toggleTerminal) keyboard shortcut.

  2. Start terminal inline chat by using the kb(workbench.action.terminal.chat.start) keyboard shortcut or running the Terminal Inline Chat command in the Command Palette.

  3. Type your prompt in the chat input field and press kbstyle(Enter).

    Screenshot showing that you can ask complex questions like "list the top 5 largest files in the src dir"

  4. Review the response and select the Run (kb(workbench.action.terminal.chat.runCommand)) to run the command in the terminal

    Alternatively, select Insert (kb(workbench.action.terminal.chat.insertCommand)) to insert the command into the terminal and modify it before running.

Change the model for inline chat

You can change the language model that is used for editor inline chat. To configure the default model for inline chat, use the setting(inlineChat.defaultModel) setting. The setting lists all available models from the model picker.

If you change the model during an inline chat session, the selection persists for the remainder of the session. After you reload VS Code, the model resets to the value specified in the setting(inlineChat.defaultModel) setting.

Learn more about choosing the right model for your task.

Use Quick Chat

Quick Chat provides a lightweight chat panel that opens at the top of the editor. Use it for quick questions and short interactions without opening the full Chat view or leaving your current workflow.

To open Quick Chat, press kb(workbench.action.quickchat.toggle) or select Quick Chat from the Chat menu in the title bar.

Type your prompt and press kbstyle(Enter) to get a response. Quick Chat supports the same #-mentions and @-mentions as the Chat view for adding context. Select the Open in Chat View button to continue the conversation in the full Chat view.

Related resources