Skip to content

TUI renders box-drawing glyphs as mojibake under ConPTY hosts on Windows (console codepage never set) #1524

Open

Description

@Futuri-Risk

Environment

  • Windows 11 x64 (build 26300), observed 2026-11-15
  • zcode CLI 0.17.1 — affects both the desktop-bundled CLI and standalone dists
  • Terminal: a ConPTY-based terminal multiplexer (herdr-core 0.1.21) whose console output codepage is the default OEM codepage

Repro

Launch the interactive TUI under a ConPTY host whose console output codepage is the default OEM codepage. All box-drawing glyphs — panel borders, spinner frames — render as mojibake (e.g. the ╭─ Yolo ─╮ header comes out as ð▒ð-style sequences); plain ASCII text is unaffected. The same mojibake appears in plain classic console windows running with codepage 437/850.

Root cause

The TUI (Node/Ink) writes UTF-8 bytes to stdout but never calls SetConsoleOutputCP(65001) (or the equivalent) on win32. libuv writes the raw UTF-8 bytes to the ConPTY pipe, and the host decodes them with the console's OEM codepage, producing mojibake. Other agent CLIs on the same machine (Rust- and Go-based TUIs) set the console codepage themselves and render correctly in the same host.

Suggested fix

On win32 at TUI startup, set the console output codepage to UTF-8 (a single SetConsoleOutputCP(65001) call), or configure the output encoding accordingly.

Workaround

Running chcp 65001 before launching the CLI fully fixes rendering.

Activity

  1. github-actions commented on Nov 15, 2026

    @github-actions

    👋 感谢你的反馈,我们已经收到。

    • 维护者看到后会尽快回复你。
    • 状态保持为 status: 待评估,你可以随时补充信息。
    • 信息不全时我们会打上 needs: 更多信息 标签并 @ 你。

    👋 Thanks — we've received your issue.

    • A maintainer will get back to you as soon as we can.
    • Status stays at status: 待评估 (Triage); feel free to add context.
    • If we need more details, we'll add needs: 更多信息 and ping you.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions