From f73f88fb56381f0ea6746964bbd4a6496f7ec229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=86=E5=A5=95=E4=B8=9E?= <01luyicheng@gmail.com> Date: Sat, 31 Jan 2026 22:55:34 +0800 Subject: [PATCH] fix(pty): Add UTF-8 encoding defaults for Windows PTY (#11459) --- packages/opencode/src/pty/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/opencode/src/pty/index.ts b/packages/opencode/src/pty/index.ts index 73474ed4f8..d01b2b02e9 100644 --- a/packages/opencode/src/pty/index.ts +++ b/packages/opencode/src/pty/index.ts @@ -108,6 +108,12 @@ export namespace Pty { TERM: "xterm-256color", OPENCODE_TERMINAL: "1", } as Record + + if (process.platform === "win32") { + env.LC_ALL = "C.UTF-8" + env.LC_CTYPE = "C.UTF-8" + env.LANG = "C.UTF-8" + } log.info("creating session", { id, cmd: command, args, cwd }) const spawn = await pty()