Terminal copy/paste: UTF-8 mojibake (— becomes ‚Äî) and blockquote gutter glyphs included in selection

Open 💬 0 comments Opened Jul 7, 2026 by baden-ballard

Summary

Selecting and copying assistant output from the Claude Code terminal UI, then pasting into another app (macOS Messages), produced mojibake for non-ASCII characters and included blockquote-gutter glyphs in the copied text.

What happened

Assistant output contained em-dashes (—, U+2014) inside a markdown blockquote. The user highlighted the rendered text in the terminal, copied, and pasted into Messages. The paste came out as:

 1. Chargebacks — what's the intended way ...
▎ 2. Idempotency — is there an idempotency key ...

Two distinct problems:

  1. Encoding: ‚Äî is the UTF-8 byte sequence for — (E2 80 94) decoded as Mac Roman/CP1252 — somewhere in the copy→clipboard→paste chain the UTF-8 text was re-interpreted in a legacy encoding.
  2. UI glyphs in selection: ‚ñé is the UTF-8 sequence for ▎ (U+258E, left one-quarter block) — the blockquote gutter bar rendered by the terminal UI was included in the text selection and copied along with the content.

Environment

  • Claude Code CLI on macOS (Darwin 25.3.0), default Terminal setup
  • Paste target: macOS Messages
  • Model session: interactive terminal (not IDE extension)

Expected

  • Copied text should paste as clean UTF-8 (em-dashes survive)
  • Rendering-only glyphs (blockquote bars, borders) should not be part of the copyable text selection

Workaround

Avoiding non-ASCII punctuation in text meant for copy-paste; not viable long-term since assistant output naturally contains typographic characters.

View original on GitHub ↗