feat(shell): Standardize pager to 'cat' for shell execution by model (#13878)

This commit is contained in:
Gal Zahavi
2025-11-26 17:23:31 -08:00
committed by GitHub
parent 69188c8538
commit b9dc8eb14d
3 changed files with 7 additions and 5 deletions

View File

@@ -221,6 +221,7 @@ export class ShellExecutionService {
GEMINI_CLI: '1',
TERM: 'xterm-256color',
PAGER: 'cat',
GIT_PAGER: 'cat',
},
});
@@ -434,6 +435,7 @@ export class ShellExecutionService {
GEMINI_CLI: '1',
TERM: 'xterm-256color',
PAGER: shellExecutionConfig.pager ?? 'cat',
GIT_PAGER: shellExecutionConfig.pager ?? 'cat',
},
handleFlowControl: true,
});

View File

@@ -222,7 +222,7 @@ describe('ShellTool', () => {
expect.any(Function),
expect.any(AbortSignal),
false,
{},
{ pager: 'cat' },
);
expect(result.llmContent).toContain('Background PIDs: 54322');
// The file should be deleted by the tool
@@ -247,7 +247,7 @@ describe('ShellTool', () => {
expect.any(Function),
expect.any(AbortSignal),
false,
{},
{ pager: 'cat' },
);
});
@@ -268,7 +268,7 @@ describe('ShellTool', () => {
expect.any(Function),
expect.any(AbortSignal),
false,
{},
{ pager: 'cat' },
);
});
@@ -295,7 +295,7 @@ describe('ShellTool', () => {
expect.any(Function),
expect.any(AbortSignal),
false,
{},
{ pager: 'cat' },
);
},
20000,

View File

@@ -241,7 +241,7 @@ export class ShellToolInvocation extends BaseToolInvocation<
},
combinedController.signal,
this.config.getEnableInteractiveShell(),
shellExecutionConfig ?? {},
{ ...shellExecutionConfig, pager: 'cat' },
);
if (pid && setPidCallback) {