gemini-cli - ✅(Solved) Fix Shell tool text output causes UI jank on high-volume commands [2 pull requests, 1 comments, 1 participants]

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…
GitHub stats
google-gemini/gemini-cli#25459Fetched 2026-04-16 07:06:09
View on GitHub
Comments
1
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2labeled ×2commented ×1mentioned ×1

Fix Action

Fixed

PR fix notes

PR #22843: fix(core): throttle shell text output UI updates

Description (problem / solution / changelog)

Summary

  • Shell tool text output (data events) triggered a React re-render on every chunk, while binary_progress already throttled to 1s intervals via OUTPUT_UPDATE_INTERVAL_MS
  • Commands that produce thousands of lines (e.g. build warnings, manifest generation with ~2000 duplicate warnings) caused the UI to freeze — each line forced a full re-render of the shell output panel
  • Apply the same OUTPUT_UPDATE_INTERVAL_MS throttle to text data events. The final output is unaffected — it is rendered from the complete result after the command exits

Test plan

  • Verified existing shell.test.ts tests are unaffected (only test using type: 'data' is for background mode which already skips updateOutput)
  • Manual test: run a command that produces high-volume output (e.g. for i in $(seq 1 5000); do echo "line $i"; done) and verify the UI remains responsive
  • Verify final output after command completion is still complete and correct

🤖 Generated with Claude Code

Changed files

  • packages/core/src/tools/shell.ts (modified, +18/-2)

PR #25461: fix(core): throttle shell text output UI updates

Description (problem / solution / changelog)

Fixes #25459

Summary

Shell tool text output (data events) triggered a React re-render on every chunk, while binary_progress already throttled to 1s intervals via OUTPUT_UPDATE_INTERVAL_MS. Commands that emit thousands of lines (verbose builds, manifest generation with ~2000 duplicate warnings) pinned the UI.

Changes

  • Apply the same OUTPUT_UPDATE_INTERVAL_MS throttle to text data chunks in shell.ts
  • PTY mode (AnsiOutput) keeps overwrite semantics; pipe mode (string) accumulates between throttled updates so no intermediate output is lost

Test plan

  • Existing shell tool tests pass
  • Manual: run a command producing thousands of lines and confirm UI stays responsive
  • Manual: run a PTY-mode command and confirm output still renders correctly

Replaces #22843 (auto-closed per contribution policy).

Changed files

  • packages/core/src/tools/shell.ts (modified, +18/-2)
RAW_BUFFERClick to expand / collapse

Bug

Shell tool data events trigger a React re-render on every chunk, while binary_progress already throttles to 1s intervals via OUTPUT_UPDATE_INTERVAL_MS.

Impact

Commands that emit thousands of lines (build warnings, manifest generation with ~2000 duplicate warnings, verbose test runs) pin the UI and make the terminal unresponsive until the command completes.

Repro

  1. Run a shell command that produces several thousand lines of stdout quickly
  2. Observe that the UI becomes laggy / unresponsive

Proposal

Apply the same OUTPUT_UPDATE_INTERVAL_MS throttling to text output that's already applied to binary_progress. The final chunk should flush immediately so users still see the final state without delay.

Related

Fix proposed in #22843 (closed per contribution policy).

extent analysis

TL;DR

Apply throttling to text output using OUTPUT_UPDATE_INTERVAL_MS to prevent excessive React re-renders.

Guidance

  • Identify the current implementation of binary_progress throttling and apply a similar approach to data events to limit the frequency of React re-renders.
  • Verify that the proposed fix does not introduce any noticeable delays in displaying the final state of the command output.
  • Consider testing the fix with various command outputs, including those that produce thousands of lines, to ensure the UI remains responsive.
  • Review the contribution policy and related fix proposed in #22843 to ensure the new solution aligns with existing guidelines.

Example

No code snippet is provided as the issue does not contain sufficient implementation details.

Notes

The proposed fix may require adjustments to ensure the final chunk of output is flushed immediately, as mentioned in the proposal.

Recommendation

Apply workaround: Implement throttling for data events using OUTPUT_UPDATE_INTERVAL_MS to improve UI responsiveness during command execution with large outputs.

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