@@ -38,7 +38,7 @@ export interface ICommandFinishedEvent {
3838 */
3939export interface IAgentHostTerminalManager {
4040 readonly _serviceBrand : undefined ;
41- createTerminal ( params : ICreateTerminalParams , options ?: { shell ?: string ; preventShellHistory ?: boolean } ) : Promise < void > ;
41+ createTerminal ( params : ICreateTerminalParams , options ?: { shell ?: string ; preventShellHistory ?: boolean ; nonInteractive ?: boolean } ) : Promise < void > ;
4242 writeInput ( uri : string , data : string ) : void ;
4343 onData ( uri : string , cb : ( data : string ) => void ) : IDisposable ;
4444 onExit ( uri : string , cb : ( exitCode : number ) => void ) : IDisposable ;
@@ -172,7 +172,7 @@ export class AgentHostTerminalManager extends Disposable implements IAgentHostTe
172172 * Create a new terminal backed by node-pty.
173173 * Spawns the user's default shell.
174174 */
175- async createTerminal ( params : ICreateTerminalParams , options ?: { shell ?: string ; preventShellHistory ?: boolean } ) : Promise < void > {
175+ async createTerminal ( params : ICreateTerminalParams , options ?: { shell ?: string ; preventShellHistory ?: boolean ; nonInteractive ?: boolean } ) : Promise < void > {
176176 const uri = params . terminal ;
177177 if ( this . _terminals . has ( uri ) ) {
178178 throw new Error ( `Terminal already exists: ${ uri } ` ) ;
@@ -199,6 +199,18 @@ export class AgentHostTerminalManager extends Disposable implements IAgentHostTe
199199 // prevents agent-executed commands from polluting the user's shell history.
200200 env [ 'VSCODE_PREVENT_SHELL_HISTORY' ] = '1' ;
201201 }
202+ if ( options ?. nonInteractive ) {
203+ // Suppress paging and interactive prompts so that tool-spawned
204+ // terminals produce clean, machine-friendly output. An empty
205+ // string disables paging in git, less, and most CLI tools and
206+ // is safe on all platforms (unlike 'cat' which isn't on Windows PATH).
207+ env [ 'LC_ALL' ] = 'C.UTF-8' ;
208+ env [ 'PAGER' ] = '' ;
209+ env [ 'GIT_PAGER' ] = '' ;
210+ env [ 'GH_PAGER' ] = '' ;
211+ env [ 'GIT_TERMINAL_PROMPT' ] = '0' ;
212+ env [ 'DEBIAN_FRONTEND' ] = 'noninteractive' ;
213+ }
202214 let shellArgs : string [ ] = [ ] ;
203215
204216 const injection = await getShellIntegrationInjection (
0 commit comments