# Terminal OSC 52 clipboard corrupts multi-byte UTF-8 (CJK/Cyrillic/emoji) — fixed upstream in VS Code 1.125, Cursor still ships the buggy addon

**URL:** <https://forum.cursor.com/t/terminal-osc-52-clipboard-corrupts-multi-byte-utf-8-cjk-cyrillic-emoji-fixed-upstream-in-vs-code-1-125-cursor-still-ships-the-buggy-addon/166453>\
**Category:** Bug Reports\
**Tags:** terminal, ssh\
**Created:** [July 23, 2026, 8:47am UTC](https://forum.cursor.com/t/terminal-osc-52-clipboard-corrupts-multi-byte-utf-8-cjk-cyrillic-emoji-fixed-upstream-in-vs-code-1-125-cursor-still-ships-the-buggy-addon/166453 "2026-07-23T08:47:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dinghao\_Yang](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@Dinghao\_Yang](https://forum.cursor.com/u/Dinghao_Yang)\
**Post date:** [July 23, 2026, 8:47am UTC](https://forum.cursor.com/t/terminal-osc-52-clipboard-corrupts-multi-byte-utf-8-cjk-cyrillic-emoji-fixed-upstream-in-vs-code-1-125-cursor-still-ships-the-buggy-addon/166453/1 "2026-07-23T08:47:13Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

Copying text that an app in the integrated terminal places on the clipboard via OSC 52 (e.g. Claude Code’s TUI mouse selection) corrupts all multi-byte UTF-8: Chinese/Cyrillic/emoji become Latin-1 mojibake (e.g. `要` → `è¦`), while ASCII in the same selection is preserved.

**Root cause:** `@xterm/addon-clipboard@0.3.0-beta.220` decodes the OSC 52 base64 payload with bare `atob()` and writes the resulting Latin-1 binary string to the clipboard without a UTF-8 decode. This regression shipped in VS Code 1.123/1.124 and was fixed upstream:

- xtermjs/xterm.js#6002
- microsoft/vscode#320646 (released in VS Code 1.125)

**Repro:**

1. Cursor 3.12.30 (macOS arm64) → Remote-SSH to a Linux host (also reproduces inside tmux).
2. Run any app that copies via OSC 52 — e.g. Claude Code, select non-ASCII text in its TUI with the mouse.
3. Paste: multi-byte characters are mojibake, ASCII is intact.

**Cross-check that isolates this to Cursor:** official VS Code 1.130.0 connected to the _same_ host over Remote-SSH copies the _same_ text correctly.

Cursor’s About panel reports the identical `xterm.js: 6.1.0-beta.256` across several recent releases (3.11.x → 3.12.30), which suggests the terminal stack (including `@xterm/addon-clipboard`) is pinned and hasn’t absorbed the upstream fix despite the VS Code API 1.128 rebase.

**Ask:** please bump the bundled `@xterm/addon-clipboard` to a version containing the xterm.js#6002 fix.

Also tracked from the app side at anthropics/claude-code#66098 (labeled `external` there, since the sender encodes correctly).

**Environment:**

- Cursor 3.12.30 (Universal), commit 63a2996a10d9e476b6c28e951dd7691d9c0cf480, macOS Darwin arm64 25.5.0
- Remote-SSH to Linux (Ubuntu, tmux 3.x), reproduces with and without tmux
- xterm.js: 6.1.0-beta.256, Electron 40.10.3

### Steps to Reproduce

1. Cursor 3.12.30 (macOS arm64) → Remote-SSH to a Linux host (also reproduces inside tmux).
2. Run any app that copies via OSC 52 — e.g. Claude Code, select non-ASCII text in its TUI with the mouse.
3. Paste: multi-byte characters are mojibake, ASCII is intact.

### Operating System

MacOS

### Version Information

- Cursor 3.12.30 (Universal), commit 63a2996a10d9e476b6c28e951dd7691d9c0cf480, macOS Darwin arm64 25.5.0
- Remote-SSH to Linux (Ubuntu, tmux 3.x), reproduces with and without tmux
- xterm.js: 6.1.0-beta.256, Electron 40.10.3

### Does this stop you from using Cursor

No - Cursor works, but with this issue

---

<div class="post-metadata">

**Author:** ![Colin](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/colin/32/90452_2.png) [@Colin](https://forum.cursor.com/u/Colin)\
**Post date:** [July 23, 2026, 11:44am UTC](https://forum.cursor.com/t/terminal-osc-52-clipboard-corrupts-multi-byte-utf-8-cjk-cyrillic-emoji-fixed-upstream-in-vs-code-1-125-cursor-still-ships-the-buggy-addon/166453/6 "2026-07-23T11:44:20Z")

</div>

Thanks for the report @Dinghao_Yang! This looks a lot like:

> [@Chinese text copied from terminal is garbled (UTF-8 mojibake)](https://forum.cursor.com/t/chinese-text-copied-from-terminal-is-garbled-utf-8-mojibake/161982):
>
> Where does the bug appear (feature/product)? Cursor IDE Describe the Bug When copying Chinese text from OpenCode on Cursor IDE’s integrated terminal, the clipboard content is corrupted. UTF-8 encoded characters are misinterpreted as Latin-1/CP1252, producing mojibake. Only happens in the latest version of Cursor IDE. Steps to Reproduce Open Cursor’s integrated terminal, launch Opencode. Run a command that outputs Chinese text, e.g. echo “附录审稿意见修改报告”(report for appendix review opinions) Selec…

> [@Cursor integrated terminal corrupts UTF-8 OSC 52 clipboard text from tmux](https://forum.cursor.com/t/-/162481):
>
> Where does the bug appear (feature/product)? Cursor IDE Describe the Bug Cursor Integrated Terminal OSC 52 Clipboard UTF-8 Bug Summary Cursor’s integrated terminal appears to mishandle OSC 52 clipboard payloads containing UTF-8 text from tmux. Copying Chinese text from tmux copy-mode produces mojibake such as ä¸­æ instead of 中文. The same workflow works correctly in VS Code. Environment OS: macOS 26.4 Cursor: 3.6.21 tmux: 3.6b Shell locale: UTF-8 Terminal: Cursor integrated terminal Minima…

We raised a bug ticket as a part of that first thread, and I’ve gone ahead and linked your report there as well! We’ve also recently bumped this ticket’s priority.

As a temporary workaround, copying the same text from a regular shell session (without a TUI) in Cursor’s terminal should work correctly

---

<div class="post-metadata">

**Author:** ![Colin](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/colin/32/90452_2.png) [@Colin](https://forum.cursor.com/u/Colin)\
**Post date:** [July 23, 2026, 1:07pm UTC](https://forum.cursor.com/t/terminal-osc-52-clipboard-corrupts-multi-byte-utf-8-cjk-cyrillic-emoji-fixed-upstream-in-vs-code-1-125-cursor-still-ships-the-buggy-addon/166453/8 "2026-07-23T13:07:18Z")

</div>

Hey again!

This was a pretty easy dependency bump, so it should make its way into 3.14. Thanks again for flagging
