gemini-cli - 💡(How to fix) Fix Ensure `shellExecutionService.ts` respects `enableInteractiveShell: false` and implements high-fidelity native bridge stability by handling non-UTF-8 bytes in the string serialization layer or when the buffer exceeds heap limits for string conversion [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

What happened?

Describe the Bug

We have identified three critical issues in the ShellExecutionService that affect stability, correctness, and security in automated or non-interactive environments (such as agent loops):

  1. Hangs in Non-Interactive Loops: When enableInteractiveShell: false is set, the terminal environment is not fully restricted. Pagers (like less) and terminal colorizers can still trigger and block execution indefinitely waiting for manual user keypresses.
  2. Native Bridge Crashes / OOM on Large Outputs: When a command produces a high-volume telemetry surge (e.g., >10MB), converting the massive buffer to string all at once in the native TTY bridge or child process stream triggers process-level segmentation faults or heap overflows.
  3. *Security Leak (GIT_CONFIG_ Bypass)**: In non-interactive mode, GIT_CONFIG_* environment variables are bypassed and restored directly from raw process.env even if they were correctly redacted by the sanitization layer due to sensitive content (e.g., GitHub OAuth tokens).

Expected Behavior

  1. Non-interactive configuration should strictly enforce TERM=dumb, PAGER=cat, and GIT_PAGER=cat to prevent blocking pagers.
  2. Output streams should be processed incrementally in stable 1MB chunks (without truncating or discarding data) to maintain native bridge stability and prevent OOMs.
  3. Environment variable sanitization should be respected for all variables, including GIT_CONFIG_*, without any bypass loops.

Additional Context

We have prepared a complete fix for this including robust unit tests for chunking and split UTF-8 boundary decoding, and a native PTY integration test harness. I will link a Pull Request shortly.

What did you expect to happen?

Expected Behavior

  1. Non-interactive configuration should strictly enforce TERM=dumb, PAGER=cat, and GIT_PAGER=cat to prevent blocking pagers.
  2. Output streams should be processed incrementally in stable 1MB chunks (without truncating or discarding data) to maintain native bridge stability and prevent OOMs.
  3. Environment variable sanitization should be respected for all variables, including GIT_CONFIG_*, without any bypass loops.

Client information

<pre><font color="#2A3044">\u2502</font> <font color="#FF79C6"><b>About Gemini CLI</b></font> <font color="#2A3044">\u2502</font> <font color="#2A3044">\u2502</font> <font color="#2A3044">\u2502</font> <font color="#2A3044">\u2502</font> <font color="#8BE9FD"><b>CLI Version</b></font> <font color="#A3AFB7">0.45.0-nightly.20260521.g854f811be-git.3cc7e5b</font> <font color="#2A3044">\u2502</font> <font color="#2A3044">\u2502</font> <font color="#8BE9FD"><b>Git Commit</b></font> <font color="#A3AFB7">3cc7e5b</font> <font color="#2A3044">\u2502</font> <font color="#2A3044">\u2502</font> <font color="#8BE9FD"><b>Model</b></font> <font color="#A3AFB7">Auto (Gemini 3)</font> <font color="#2A3044">\u2502</font> <font color="#2A3044">\u2502</font> <font color="#8BE9FD"><b>Sandbox</b></font> <font color="#A3AFB7">no sandbox</font> <font color="#2A3044">\u2502</font> <font color="#2A3044">\u2502</font> <font color="#8BE9FD"><b>OS</b></font> <font color="#A3AFB7">linux</font> </pre>

Login information

No response

Anything else we need to know?

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING