diff --git a/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.ts b/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.ts index e97b601337931..82fc56c6669fa 100644 --- a/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.ts +++ b/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.ts @@ -148,6 +148,11 @@ export class ToolTerminalCreator { const shellPath = isString(shellOrProfile) ? shellOrProfile : shellOrProfile.path; const env: Record = { + // Let CLI tools detect that they are running inside an AI agent. + // This allows programs to adapt their output (e.g. JSON instead of + // ANSI, disable interactive prompts, skip animations). + // See https://github.com/microsoft/vscode/issues/311734 + COPILOT_AGENT: '1', // Avoid making `git diff` interactive when called from copilot GIT_PAGER: 'cat', // Prevent git from opening an editor for merge commits