302
env[AiAgentEnvVar] = AiAgentEnvValue;
303
if (options?.preventShellHistory) {
305
>
// (bash) / HIST_IGNORE_SPACE (zsh), or suppress PSReadLine history (pwsh).
306
>
// Combined with the leading-space prefix applied at command-write time, this
307
>
// prevents agent-executed commands from polluting the user's shell history.
308
>
env['VSCODE_PREVENT_SHELL_HISTORY'] = '1';
309
>
}
310
// Zsh-specific fixups for agent tool terminals: disable bang history
311
// expansion and enable inline # comments.
312
if (params.claim?.kind === TerminalClaimKind.Session && isZsh(shell)) {
314
>
}
315
if (options?.nonInteractive) {
317
>
// terminals produce clean, machine-friendly output. An empty
318
>
// string disables paging in git, less, and most CLI tools and
319
>
// is safe on all platforms (unlike 'cat' which isn't on Windows PATH).
320
>
env['LC_ALL'] = 'C.UTF-8';
321
>
env['PAGER'] = '';
322
>
env['GIT_PAGER'] = '';
323
>
env['GH_PAGER'] = '';
324
>
env['GIT_TERMINAL_PROMPT'] = '0';
325
>
env['DEBIAN_FRONTEND'] = 'noninteractive';
326
>
}
327
let shellArgs: string[] = [];
328
if (platform.isMacintosh) {