mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 14:23:02 -07:00
fix(shell): explicitly set PAGER=cat when rcFile is not used
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user