anomalyco / anomalyco/opencode

Copying Cyrillic text copies Unicode escape sequences (\uXXXX) instead of UTF-8 on Wayland

Open
#38,635 0 comments 0 reactions 1 assignee View on GitHub

@simonklee is already working on this.

Since Jul 24, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Copying Cyrillic text to the clipboard produces Unicode escape sequences (\uXXXX) instead of UTF-8 (Ubuntu 24.04 Wayland in UTM)

Description

I'm running OpenCode inside an Ubuntu 24.04 ARM64 virtual machine using UTM on macOS (Apple Silicon M1).

When I select and copy Cyrillic (Russian) text from the OpenCode TUI, the clipboard contains JSON-style Unicode escape sequences instead of normal UTF-8 text.

The issue occurs before the text leaves Ubuntu. I verified this using wl-paste, which already returns escaped Unicode sequences.

This makes it impossible to correctly paste Russian text into macOS applications such as ChatGPT, web browsers, text editors, and other applications.


Environment

  • OpenCode: 1.18.4
  • Guest OS: Ubuntu 24.04 ARM64
  • Display Server: Wayland
  • Virtualization: UTM
  • Host OS: macOS
  • Hardware: MacBook Air M1 (Apple Silicon)

Steps to Reproduce

  1. Launch OpenCode.
  2. Generate some Cyrillic text, for example:
Привет мир
  1. Select the text with the mouse.
  2. Copy it.
  3. Verify the clipboard contents:
wl-paste

Expected Behavior

Привет мир

Actual Behavior

\u041f\u0440\u0438\u0432\u0435\u0442 \u043c\u0438\u0440

Clipboard MIME Types

Running:

wl-paste --list-types

returns:

text/plain
TEXT
STRING
text/plain;charset=utf-8
UTF8_STRING
MULTIPLE
TARGETS
TIMESTAMP

The clipboard correctly advertises UTF-8 (text/plain;charset=utf-8), but the actual clipboard content already contains escaped Unicode sequences instead of plain UTF-8 text.


Verification

OpenCode version:

$ opencode --version
1.18.4

Clipboard content:

$ wl-paste
\u041f\u0440\u0438\u0432\u0435\u0442 \u043c\u0438\u0440

Clipboard MIME types:

$ wl-paste --list-types

text/plain
TEXT
STRING
text/plain;charset=utf-8
UTF8_STRING
MULTIPLE
TARGETS
TIMESTAMP

Additional Information

I confirmed that the issue occurs before the clipboard content reaches macOS.

Running:

wl-paste

already returns escaped Unicode sequences instead of UTF-8 text.

This suggests that OpenCode is writing escaped Unicode into the clipboard rather than normal UTF-8 text.

I have only reproduced this issue inside Ubuntu running in UTM on macOS. I have not yet tested whether the same behavior occurs on native Linux installations.


Notes

This issue appears to affect clipboard serialization of Unicode/Cyrillic characters.

ASCII text copies correctly.

Only non-ASCII (tested with Russian/Cyrillic) text is written into the clipboard as JSON-style Unicode escape sequences (\uXXXX) instead of UTF-8 text.

If additional debugging information or testing is needed, I'd be happy to help.

Plugins

No response

OpenCode version

1.18.4

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.