Terminal UI not filling full width - right side truncated in iTerm2
Bug Description
Claude Code CLI terminal UI does not fill the full terminal width. The right side is truncated/truncated, leaving significant empty space on the right.
Environment
- OS: macOS (Darwin 25.2.0)
- Terminal: iTerm2
- Claude Code version: Latest
- Shell: zsh
- TERM: xterm-256color
Reproduction
- Open iTerm2 in full screen or large window
- Launch
claude - Observe that the UI renders in a narrow column, not filling the full terminal width
Diagnosis
When checking terminal dimension detection from within Claude Code's tool execution environment:
$COLUMNS: 0
$LINES: 0
tput cols: 80 (fallback default)
tput lines: 24 (fallback default)
The $COLUMNS and $LINES environment variables are reporting 0, and tput cols falls back to the default 80x24. This suggests the terminal width detection is failing, causing Claude Code's Ink renderer to use a narrow default width.
Expected Behavior
Claude Code should detect the actual terminal width and render the UI to fill the full available width.
Screenshots
The UI content is rendered in approximately 80 columns width while the terminal window is much wider, leaving the right portion of the terminal empty.
Possible Cause
Claude Code uses Ink (React-based CLI rendering framework) which relies on terminal dimension detection. When $COLUMNS is 0 or unavailable, Ink likely falls back to a default narrow width instead of querying the terminal directly via ioctl(TIOCGWINSZ) or equivalent.
Workaround Attempted
- Manually setting
export COLUMNS=$(tput cols)in.zshrcdid not resolve the issue CLAUDE_CODE_NO_FLICKER=1did not help either
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗