hermes - 💡(How to fix) Fix fix(tui): TUI not resizing properly - add SIGWINCH fallback

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 resize handling in useMainApp.ts only registered a listener for the Ink stdout object's 'resize' event. There was no fallback for environments where this event doesn't fire reliably.

Fix Action

Solution

Added a SIGWINCH signal listener as a fallback mechanism. The SIGWINCH signal is the standard Unix signal for terminal window size changes.

RAW_BUFFERClick to expand / collapse

Problem

The Hermes Desktop TUI does not properly handle terminal resize events in all cases. While the code listens for stdout.on('resize') events via Ink's useStdout() hook, certain terminals or environments may not properly emit these events, causing the UI to become misaligned or not redraw after terminal resize.

Root Cause

The resize handling in useMainApp.ts only registered a listener for the Ink stdout object's 'resize' event. There was no fallback for environments where this event doesn't fire reliably.

Solution

Added a SIGWINCH signal listener as a fallback mechanism. The SIGWINCH signal is the standard Unix signal for terminal window size changes.

Changes

File: ui-tui/src/app/useMainApp.ts

  1. Added sigwinchHandler function
  2. Registered handler with process.on('SIGWINCH', sigwinchHandler)
  3. Added cleanup in useEffect return function
  4. Wrapped in try-catch for cross-platform compatibility

Testing

  1. Run hermes --tui
  2. Resize terminal window
  3. Verify UI properly redraws

Related Commits

  • f63ef74ea: fix(tui): refresh virtual transcript on viewport resize
  • 511b8e232: fix(tui): re-check sticky inside resize debounce
  • 0277194e3: fix(tui): preserve transcript tail across resizes

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

hermes - 💡(How to fix) Fix fix(tui): TUI not resizing properly - add SIGWINCH fallback