How to Use GitHub Copilot Chat in the VS Code Terminal
🔍 WiseChecker

How to Use GitHub Copilot Chat in the VS Code Terminal

You want to ask questions and get code suggestions directly inside the VS Code integrated terminal without switching to the editor or a separate chat panel. GitHub Copilot Chat now works in the terminal window, letting you generate commands, explain shell output, and debug scripts without leaving your command line. This article explains how to enable terminal chat, what slash commands are available, and how to use Copilot to write and fix terminal commands.

Key Takeaways: Using Copilot Chat in the VS Code Terminal

  • Ctrl+Shift+I or Cmd+Shift+I: Opens the Copilot Chat input box directly in the VS Code integrated terminal.
  • Slash commands like /explain and /fix: Generate explanations of shell output or fix errors without copying text to the editor.
  • Terminal inline chat vs panel chat: Inline chat is context-aware of the current terminal session and working directory.

What the VS Code Terminal Copilot Chat Feature Does

GitHub Copilot Chat in the VS Code terminal is an extension of the standard Copilot Chat feature. It gives you a dedicated input box inside the terminal panel where you can type natural language questions or slash commands. The model sees the current terminal buffer, your shell prompt, and the working directory. This context lets Copilot generate relevant commands, explain error messages, or suggest debugging steps based on what is on your screen.

You need these prerequisites before you start:

  • VS Code version 1.85 or later
  • GitHub Copilot extension version 1.150.0 or later
  • An active GitHub Copilot subscription (Individual, Business, or Enterprise)
  • GitHub Copilot Chat extension installed and enabled

Terminal chat does not replace the Copilot Chat panel on the left sidebar. Both tools coexist. The terminal version is optimized for command-line workflows, while the panel version is better for multi-file code generation and long conversations.

Open and Use Copilot Chat in the Terminal

Follow these steps to start a chat session inside the integrated terminal.

  1. Open the integrated terminal
    Press Ctrl+Backtick or select Terminal > New Terminal from the VS Code menu bar. The terminal panel appears at the bottom of the window.
  2. Open the Copilot Chat input box
    Press Ctrl+Shift+I on Windows or Linux, or Cmd+Shift+I on macOS. A small input box appears at the bottom of the terminal panel. You can also click the Copilot icon in the terminal toolbar if it is visible.
  3. Type your question or command
    Enter a natural language prompt such as “How do I find all files modified in the last 24 hours?” Press Enter to send the query. Copilot responds directly in the terminal with the command and an explanation.
  4. Insert a suggested command
    When Copilot generates a command, click the Insert button that appears below the response. The command is pasted into the terminal prompt but is not executed automatically. Press Enter to run it after reviewing.
  5. Continue the conversation
    Type follow-up questions in the same input box. Copilot remembers the conversation history for the current terminal session. To start a new topic, use the /clear slash command.

Slash Commands for Terminal Chat

Slash commands let you perform specific actions without typing full sentences. Type a forward slash followed by the command name in the chat input box.

  • /explain — Paste or reference an error message from the terminal. Copilot explains what the error means and suggests a fix.
  • /fix — Copilot analyzes the last shell command that failed and proposes a corrected version.
  • /help — Shows a list of available slash commands and keyboard shortcuts for terminal chat.
  • /clear — Clears the conversation history for the current session. Copilot no longer remembers previous questions.

Common Mistakes and Limitations of Terminal Chat

Copilot Chat Does Not Appear in the Terminal

If pressing Ctrl+Shift+I does nothing, check that both the GitHub Copilot and GitHub Copilot Chat extensions are installed and enabled. Open the Extensions view, search for each extension, and verify the status shows a blue Install button or a green Enabled indicator. Restart VS Code after installing or updating the extensions.

Copilot Suggests Incorrect Commands for Your Shell

Terminal chat detects your default shell from the VS Code setting terminal.integrated.shellArgs.linux, terminal.integrated.shellArgs.osx, or terminal.integrated.shellArgs.windows. If you use a shell that is not the default, such as PowerShell Core on Windows or Zsh on macOS, specify the shell path in your VS Code settings.json file. For example, add "terminal.integrated.defaultProfile.windows": "PowerShell" to point to the correct shell. Copilot then generates commands compatible with that shell.

Copilot Does Not See the Full Terminal Buffer

Terminal chat only sees the last 200 lines of the terminal buffer by default. If an error or output you want to reference is scrolled out of view, scroll up in the terminal and then trigger the chat input box. Copilot captures the visible buffer at the moment you open the input box. Older lines are not included in the context.

Conversation History Resets After Closing the Terminal

Terminal chat history is tied to the terminal tab. If you close the tab or restart VS Code, the conversation is lost. To preserve a useful response, copy it to a text file or use the Copy button that appears when you hover over a Copilot response.

Copilot Chat in Terminal vs Copilot Chat Panel: Key Differences

Item Terminal Chat Chat Panel (Sidebar)
Context source Terminal buffer, working directory, shell prompt Open editor tabs, selected code, file tree
Primary use case Command generation, error explanation, shell debugging Code writing, refactoring, multi-file changes
Keyboard shortcut Ctrl+Shift+I or Cmd+Shift+I Ctrl+Shift+I or Cmd+Shift+I (same key but different panel)
Conversation persistence Lost when terminal tab closes Persists across sessions until manually cleared
Slash commands /explain, /fix, /help, /clear /explain, /fix, /help, /clear, /tests, /doc, /optimize

Both tools share the same underlying large language model. The difference is what context Copilot uses to generate responses. Terminal chat is optimized for command-line tasks, while the sidebar panel is better for code editing.

You can now use GitHub Copilot Chat to generate shell commands, explain errors, and debug scripts directly inside the VS Code terminal. Start by pressing Ctrl+Shift+I the next time you see an error message or need to recall a command. For more advanced tasks like generating unit tests or documenting code, switch to the Copilot Chat panel using the same keyboard shortcut but clicking the chat icon in the sidebar first.