hermes - 💡(How to fix) Fix CLI terminal resize triggers slow full-history re-render on long conversations

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…

Root Cause

The _recover_after_resize() mechanism in cli.py replays the full output history as an ANSI payload after SIGWINCH. While it batches into a single prompt_toolkit print, the amount of data grows linearly with conversation length — sessions with 50+ messages replay hundreds of terminal lines. Cursor state recovery then syncs the full scrollback, causing the delay.

RAW_BUFFERClick to expand / collapse

Problem

When using the classic CLI (non --tui mode), any terminal resize or window move triggers a visible full-conversation re-render. For long conversations (50+ messages) this takes several seconds, making the terminal feel unresponsive. Users perceive it as "reloading everything from scratch."

Root Cause

The _recover_after_resize() mechanism in cli.py replays the full output history as an ANSI payload after SIGWINCH. While it batches into a single prompt_toolkit print, the amount of data grows linearly with conversation length — sessions with 50+ messages replay hundreds of terminal lines. Cursor state recovery then syncs the full scrollback, causing the delay.

Steps to Reproduce

  1. Start hermes (classic CLI)
  2. Have a conversation with 20+ exchanges
  3. Drag the terminal window to resize it, or switch to a different terminal tab and back
  4. Observe full conversation text reappearing and sluggish response

Expected Behavior

Resizing should be instant and invisible:

  1. Preserve existing terminal scrollback — only re-render the input prompt/footer area to match the new width
  2. If full redraw is unavoidable, complete in <100ms regardless of conversation length
  3. Terminal tab switches should not cause visible re-rendering

Suggested Approaches

  1. Preserve scrollback — on resize, only redraw the input prompt line + status bar instead of replaying the entire conversation history
  2. Lazy replay — show a brief status message during resize and defer full UI restoration until the next user interaction
  3. Better debounce — increase debounce delay and cancel stale redraws during resize storms

Environment

  • Hermes Agent 0.14.0
  • macOS (Terminal.app / iTerm2)
  • Classic CLI mode (not --tui)

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