! shell escape commands report COLUMNS=80 regardless of actual terminal width
Resolved 💬 3 comments Opened Apr 1, 2026 by sstraus Closed Apr 5, 2026
! shell escape commands report COLUMNS=80 regardless of actual terminal width
When running ! tput cols or checking $COLUMNS via the ! shell escape in Claude Code, the reported terminal width is always 80 regardless of the actual PTY dimensions.
Observed behavior
! tput cols→ always returns80! echo $COLUMNS→ always returns80process.stdout.columns(via Bash tool) →undefinedor80- This happens at any zoom level or terminal width
Expected behavior
The ! shell escape should inherit the PTY dimensions from the parent process. The PTY correctly reports its dimensions via TIOCGWINSZ — tput cols in a plain shell (outside CC) returns the correct value and updates on resize.
Impact
- The HUD/status line in CC cannot adapt to different terminal widths
- Any
!command that relies on terminal width for formatting produces wrong output - Third-party tools launched via
!cannot detect available width
Environment
- macOS (Darwin 25.4.0, arm64)
- Claude Code v2.1.89
- Tested in: iTerm2, xterm.js (via Tauri/TUICommander)
- PTY resize signals (SIGWINCH) are correctly delivered — verified via
tput colsin a plain shell within the same PTY before launching CC
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗