fix(shell): explicitly set PAGER=cat when rcFile is not used

This commit is contained in:
jacob314
2026-04-20 11:50:24 -07:00
parent dc82a395ac
commit 66abea7a0e
3 changed files with 13 additions and 0 deletions
+5
View File
@@ -1452,6 +1452,11 @@ their corresponding top-level category object in your `settings.json` file.
performance.
- **Default:** `true`
- **`tools.shell.rcFile`** (string):
- **Description:** The path to a bash file (e.g., .bashrc) to source before
executing shell commands.
- **Default:** `undefined`
- **`tools.core`** (array):
- **Description:** Restrict the set of built-in tools with an allowlist. Match
semantics mirror tools.allowed; see the built-in tools documentation for
+2
View File
@@ -466,6 +466,8 @@ export class ShellToolInvocation extends BaseToolInvocation<
const rcFilePath = this.context.config.getShellToolRcFile();
if (rcFilePath) {
strippedCommandWithRc = `source ${rcFilePath} && ${strippedCommand}`;
} else if (!isWindows) {
strippedCommandWithRc = `export PAGER=cat GIT_PAGER=cat; more() { cat "$@"; }; less() { cat "$@"; }; ${strippedCommand}`;
}
try {
+6
View File
@@ -2509,6 +2509,12 @@
"markdownDescription": "Enable shell output efficiency optimizations for better performance.\n\n- Category: `Tools`\n- Requires restart: `no`\n- Default: `true`",
"default": true,
"type": "boolean"
},
"rcFile": {
"title": "Shell Tool RC File",
"description": "The path to a bash file (e.g., .bashrc) to source before executing shell commands.",
"markdownDescription": "The path to a bash file (e.g., .bashrc) to source before executing shell commands.\n\n- Category: `Tools`\n- Requires restart: `no`",
"type": "string"
}
},
"additionalProperties": false