Repository navigation
Set COPILOT_AGENT env var in agent terminals - #316267
Merged
Merged
Conversation
Fixes #311734 Set COPILOT_AGENT=1 in agent terminal sessions so CLI tools can detect they are running inside an AI agent and adapt their output (e.g. JSON instead of ANSI, disable interactive prompts, skip animations). This follows the same pattern as other agents (CLAUDE_CODE, CURSOR_AGENT, etc.). Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Sets a Copilot-specific environment marker for agent-created terminal sessions so child CLI tools can detect they are running under VS Code Copilot agent execution.
Changes:
- Adds
COPILOT_AGENT: '1'to the environment passed to agent terminal creation. - Documents the intent and links the associated feature request.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.ts |
Adds the COPILOT_AGENT environment variable alongside existing agent terminal Git-related environment defaults. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
Eleanor Boyd (eleanorjboyd)
approved these changes
May 13, 2026
Nikola Hristov (NikolaRHristov)
pushed a commit
to DependencyCodeEditorLand/Editor
that referenced
this pull request
May 13, 2026
Fixes microsoft#311734 Set COPILOT_AGENT=1 in agent terminal sessions so CLI tools can detect they are running inside an AI agent and adapt their output (e.g. JSON instead of ANSI, disable interactive prompts, skip animations). This follows the same pattern as other agents (CLAUDE_CODE, CURSOR_AGENT, etc.). Co-authored-by: Megan Rogge <[email protected]> Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #311734
Sets
COPILOT_AGENT=1in agent terminal sessions so CLI tools can detect they are running inside an AI agent and adapt their output (e.g. JSON instead of ANSI, disable interactive prompts, skip animations).This follows the same pattern as other agents:
CLAUDE_CODECURSOR_AGENTCODEX_SANDBOXGEMINI_CLICOPILOT_AGENTChanges
toolTerminalCreator.ts: AddedCOPILOT_AGENT: '1'to the env vars set when creating agent terminals