Terminal UI not filling full width - right side truncated in iTerm2

Resolved 💬 3 comments Opened Apr 9, 2026 by daohewang Closed Apr 12, 2026

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

  1. Open iTerm2 in full screen or large window
  2. Launch claude
  3. 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 .zshrc did not resolve the issue
  • CLAUDE_CODE_NO_FLICKER=1 did not help either

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗