[BUG] Claude Code truncates the status line without a explicit $env:COLUMNS workaround

Resolved 💬 4 comments Opened Feb 23, 2026 by mattiasbe Closed Feb 26, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

On windows Status line gets truncated on one machine, identical settings incl claude and ccstatusline config.

Executing
npx -y ccstatusline@latest
Show the same working fine on both machines outside claude.

Claude trying to resolve it, final conclusion and also showing the error:

<img width="1414" height="626" alt="Image" src="https://github.com/user-attachments/assets/723d766c-9f1b-4bb3-8d24-f601dc1188e4" />
As text:

Now we know the root cause: Claude Code's Node.js process isn't detecting the terminal width correctly on this machine.

  To make this permanent, add it to your PowerShell profile so it's always set. In PowerShell run:

  $Host.UI.RawUI.WindowSize.Width

  Then use that value (you said 202 earlier). To add it to your profile:

  notepad $PROFILE

  Add this line:

  $env:COLUMNS = $Host.UI.RawUI.WindowSize.Width

  This dynamically sets COLUMNS to the actual terminal width each time you open a shell. Save and restart Windows Terminal.

  Alternatively, if you want it to update when you resize the terminal too, you could just set a fixed large value like $env:COLUMNS = 200 in your profile — though it won't adapt to resizing.

  Worth also running node -e "console.log(process.stdout.columns)" on both machines sometime to confirm the Node.js detection difference, in case it's worth reporting as a bug to the Claude Code team.

❯  result:
  node -e "console.log(process.stdout.columns)"
  202

● That's interesting — Node.js reports the correct 202 columns, yet Claude Code still truncates the status line without the explicit $env:COLUMNS workaround. So it's not a Node.js or ConPTY issue —
  something in Claude Code's own startup is losing the terminal width.

  This looks like a Claude Code bug on Windows. Worth reporting at:
  https://github.com/anthropics/claude-code/issues

  Key details for the bug report:
  - Windows 11, Windows Terminal + PowerShell
  - Claude Code 2.1.50
  - node -e "console.log(process.stdout.columns)" correctly reports 202
  - tput cols inside Claude Code's bash reports 80
  - Status line truncated with ...
  - Workaround: $env:COLUMNS = 200; claude

  In the meantime, the $PROFILE fix will keep things working for you.

I've restarted terminal and claude, no difference.

### What Should Happen?

It should show the full statusline without truncating:

<img width="811" height="43" alt="Image" src="https://github.com/user-attachments/assets/b21c7d3e-fe3b-4680-b2fe-3d4d3f3b4cb2" />

### Error Messages/Logs

```shell

Steps to Reproduce

I can reproduce it always on one machine and never on the other by just starting claude, every time.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.50

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

Edited to fix formatting of second picture not showing.

View original on GitHub ↗

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