Feature: Force full TUI repaint after terminal resize to fix squished output
Problem
When Claude Code runs inside a terminal that gets temporarily resized (e.g., a split pane or side panel opens, shrinking the terminal from 120 to 60 cols), the output rendered during the narrow period stays "squished" after the terminal expands back. Short 60-char lines remain in scrollback even though the terminal is now 120 cols wide.
This is because Ink (the TUI renderer) only redraws the current frame on SIGWINCH — scrollback content is immutable terminal cell data that no terminal emulator can reflow.
Reproduction
- Run Claude Code in a terminal that supports split panes (tmux, terminal multiplexer, Tauri-based terminal)
- Start a conversation — let it render several screens of output
- Shrink the terminal width significantly (e.g., open a side panel)
- Wait for Claude Code to render a few responses at the narrow width
- Expand the terminal back to full width
- Scroll up — the output from step 4 is squished (short lines in a wide terminal)
Proposed solution
Listen for SIGUSR1 (or respond to SIGWINCH with a full clear+redraw instead of incremental update) and trigger Ink's full re-render — clearing the screen and redrawing all visible output at the current terminal width.
This would allow terminal embedders to send kill -SIGUSR1 <pid> after a resize to get a clean repaint.
Related upstream issue: https://github.com/vadimdemedes/ink/issues/942
Context
This affects any terminal multiplexer or embedding scenario. The issue is fundamental to how TUI frameworks handle resize — they only redraw the current viewport, not scrollback. A mechanism to force a full repaint would benefit all terminal embedding use cases.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗