[BUG] [CRITICAL] Unicode filenames crash JavaScript engine in v2.0.70 on Windows - Chalk template parsing error
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?
Critical Bug: Unicode Filenames Cause JavaScript Engine Crash
Version: Claude Code v2.0.70
OS: Windows 10/11
Severity: 🔴 Critical (Complete Blocker)
Component: Terminal UI Rendering (Chalk Library Integration)
---
Reproduction Steps
- Launch Claude Code v2.0.70 on Windows
- Execute any command that displays or creates a file with Unicode characters:
```bash
Create test-中文文件.md
# OR
List files (containing "O1.01产品-EasyConfig产品定义-两编辑器独立模式-v2.md")
What Should Happen?
Instant crash with undefined is not a constructor error
Actual Behavior
ERROR undefined is not a constructor (evaluating 'new W($, A)')
B:/~BUN/root/claude.exe:1077:5029
Chalk template literal is missing
Found extraneous } in Chalk template literal
Root Cause Analysis
Chalk v4.x cannot handle Unicode strings in template literals. When rendering filenames containing Chinese/Japanese/Unicode characters, Chalk's template parser misinterprets Unicode code points as malformed template syntax, causing bracket mismatches and attempting to instantiate an undefined constructor.
Error Messages/Logs
Key Findings:
Crash occurs at B:/~BUN/root/claude.exe:1077:5029 (Chalk rendering layer)
External env vars (FORCE_COLOR=0, NO_COLOR=1) do not work due to Bun runtime isolation
Issue is not path-related (\ vs /) but pure Unicode string handling
Both forward slashes and backslashes trigger the bug when Unicode is present
Stack trace reveals Chalk template literal is missing error
Temporary Workaround
Steps to Reproduce
Must bypass UI rendering layer using JavaScript code blocks:
JavaScript
const fs = require('fs');
fs.writeFileSync('test-中文文件.md', 'content', 'utf-8');
Suggested Fixes
Immediate: Wrap filename strings with JSON.stringify() before passing to Chalk
Short-term: Disable color formatting for filenames containing /[\^@-\uFFFF]/
Long-term: Upgrade Chalk to v5+ (has fixed Unicode template parsing)
Alternative: Replace Chalk with a Unicode-safe library like picocolors
Impact
100% blocker for users working with non-ASCII filenames
Affects all file operations: create, list, read, write
No viable workaround without abandoning natural language commands
Environment
Node Version: Bundled with Claude Code
Shell: PowerShell 7.4 / CMD
Claude Code: v2.0.70 (latest)
Attachments
Full stack trace screenshot: [Attach image]
Reproduction video: [Optional]
/cc @anthropics-team @xterm-js @chalk
Please prioritize - this completely breaks functionality for international users.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
v2.0.70
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗