Describe the bug
When using the /copy command in a WSL2 environment, copying Chinese/non-ASCII text results in garbled characters when pasted on the Windows side.
For example, copying 你好世界,测试中文 produces garbled output like 浣犲ソ涓栫晫锛屾祴璇曚腑鏂 — UTF-8 bytes reinterpreted as the system's ANSI code page (CP936 on Chinese Windows).
To Reproduce
- Run
hermes --tui inside WSL2 (Windows Terminal)
- Ask the agent to output Chinese text
- Use
/copy to copy the text
- Paste (Ctrl+V) into any Windows application (Notepad, browser, etc.)
Expected behavior
All Unicode characters should be preserved correctly in the clipboard.
Environment
- OS: Windows 11 with WSL2 (Ubuntu)
- Terminal: Windows Terminal
- Hermes version: 0.15.1
- Windows system locale: Chinese (code page 936)
Additional context
Affects all non-ASCII characters — CJK, emoji, accented characters, etc. The text displays correctly in the TUI itself, but becomes garbled after /copy and paste. The clipboard write goes through powershell.exe Set-Clipboard, where the piped stdin is decoded using the system's default code page instead of UTF-8.
Describe the bug
When using the
/copycommand in a WSL2 environment, copying Chinese/non-ASCII text results in garbled characters when pasted on the Windows side.For example, copying
你好世界,测试中文produces garbled output like浣犲ソ涓栫晫锛屾祴璇曚腑鏂— UTF-8 bytes reinterpreted as the system's ANSI code page (CP936 on Chinese Windows).To Reproduce
hermes --tuiinside WSL2 (Windows Terminal)/copyto copy the textExpected behavior
All Unicode characters should be preserved correctly in the clipboard.
Environment
Additional context
Affects all non-ASCII characters — CJK, emoji, accented characters, etc. The text displays correctly in the TUI itself, but becomes garbled after
/copyand paste. The clipboard write goes throughpowershell.exe Set-Clipboard, where the piped stdin is decoded using the system's default code page instead of UTF-8.