shelley: fix double encoding of UTF-8 in terminal output
Philip Zeyliger
and
Shelley
created
phil: This is one of those amazing things that Sketch ran
into, and six months later, the agents are still writing this one
not quite right. Had to do some handholding here.
Prompt: Fix https://github.com/boldsoftware/shelley/issues/79
The terminal widget was using atob() to decode base64 data from the
WebSocket, which returns a binary string where each byte becomes a
separate character. When passed to xterm.js term.write(), each byte
was interpreted as a Unicode code point, causing multi-byte UTF-8
sequences (like box-drawing characters ├──) to render as mojibake.
Fix by decoding the base64 data into a Uint8Array and passing that
to term.write(), which correctly handles raw bytes and decodes UTF-8
properly.
Fixes https://github.com/boldsoftware/shelley/issues/79
Co-authored-by: Shelley <shelley@exe.dev>