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.
6 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
It’s not a duplicate.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
Easy workaround:
/resumeFYI Yes it's still relevant. It happens to me every day after I turn off external screens and close the laptop lid, and resume everything the next day (Linux mint 22.1). Scrollback squeezes to something like width 10 or something crazy, not even related to how small the gnome-terminal window ever gets.
I found a workaround that "works" ok. Resize the font window a lot, to include everything you want to redraw (
Cmd+-) then reset back to the right font. The part that was re-drawn will be ok.This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.