From d4fa1a85a0160c890f4679743e79f9c395c0cb68 Mon Sep 17 00:00:00 2001 From: Observer-GGboy <66556593+Observer-GGboy@users.noreply.github.com> Date: Fri, 16 Jan 2026 11:54:27 +0800 Subject: [PATCH 1/4] fix(app): serve a valid web manifest --- packages/app/public/site.webmanifest | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/app/public/site.webmanifest b/packages/app/public/site.webmanifest index a116d787962..41290e840c3 120000 --- a/packages/app/public/site.webmanifest +++ b/packages/app/public/site.webmanifest @@ -1 +1,21 @@ -../../ui/src/assets/favicon/site.webmanifest \ No newline at end of file +{ + "name": "OpenCode", + "short_name": "OpenCode", + "icons": [ + { + "src": "/web-app-manifest-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "/web-app-manifest-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} From 80683b29665b752aa8d9669fd2e619ab7b2febfe Mon Sep 17 00:00:00 2001 From: Observer-GGboy <66556593+Observer-GGboy@users.noreply.github.com> Date: Fri, 16 Jan 2026 11:28:54 +0800 Subject: [PATCH 2/4] Fix app custom element typings on Windows Replace placeholder path with real typings so typecheck passes on Windows. --- packages/app/src/custom-elements.d.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/app/src/custom-elements.d.ts b/packages/app/src/custom-elements.d.ts index e4ea0d6cebd..49ec4449fa2 120000 --- a/packages/app/src/custom-elements.d.ts +++ b/packages/app/src/custom-elements.d.ts @@ -1 +1,17 @@ -../../ui/src/custom-elements.d.ts \ No newline at end of file +import { DIFFS_TAG_NAME } from "@pierre/diffs" + +/** + * TypeScript declaration for the custom element. + * This tells TypeScript that is a valid JSX element in SolidJS. + * Required for using the @pierre/diffs web component in .tsx files. + */ + +declare module "solid-js" { + namespace JSX { + interface IntrinsicElements { + [DIFFS_TAG_NAME]: HTMLAttributes + } + } +} + +export {} From 95b2c45102cd534c40ef06bdd40adc1c2422ee98 Mon Sep 17 00:00:00 2001 From: Observer-GGboy <66556593+Observer-GGboy@users.noreply.github.com> Date: Fri, 16 Jan 2026 11:32:34 +0800 Subject: [PATCH 3/4] Fix enterprise custom element typings on Windows Replace placeholder path with real typings so typecheck passes on Windows. --- packages/enterprise/src/custom-elements.d.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/enterprise/src/custom-elements.d.ts b/packages/enterprise/src/custom-elements.d.ts index e4ea0d6cebd..49ec4449fa2 120000 --- a/packages/enterprise/src/custom-elements.d.ts +++ b/packages/enterprise/src/custom-elements.d.ts @@ -1 +1,17 @@ -../../ui/src/custom-elements.d.ts \ No newline at end of file +import { DIFFS_TAG_NAME } from "@pierre/diffs" + +/** + * TypeScript declaration for the custom element. + * This tells TypeScript that is a valid JSX element in SolidJS. + * Required for using the @pierre/diffs web component in .tsx files. + */ + +declare module "solid-js" { + namespace JSX { + interface IntrinsicElements { + [DIFFS_TAG_NAME]: HTMLAttributes + } + } +} + +export {} From fc6d81ad8b63242ad08a2b0e63f7b5763dc2a855 Mon Sep 17 00:00:00 2001 From: Observer-GGboy <66556593+Observer-GGboy@users.noreply.github.com> Date: Sun, 25 Jan 2026 12:47:58 +0800 Subject: [PATCH 4/4] fix(pty): add UTF-8 defaults for Windows PTY Add platform-specific UTF-8 environment variables and shell startup args for better CJK character support on Windows. - Set LANG and LC_ALL to en_US.UTF-8 - Set PYTHONUTF8 and PYTHONIOENCODING for Python scripts - Add chcp 65001 for CMD.exe - Configure PowerShell UTF-8 encoding --- packages/opencode/src/pty/index.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/pty/index.ts b/packages/opencode/src/pty/index.ts index 73474ed4f87..593cc50e5ba 100644 --- a/packages/opencode/src/pty/index.ts +++ b/packages/opencode/src/pty/index.ts @@ -8,6 +8,7 @@ import type { WSContext } from "hono/ws" import { Instance } from "../project/instance" import { lazy } from "@opencode-ai/util/lazy" import { Shell } from "@/shell/shell" +import path from "path" export namespace Pty { const log = Log.create({ service: "pty" }) @@ -96,10 +97,23 @@ export namespace Pty { export async function create(input: CreateInput) { const id = Identifier.create("pty", false) const command = input.command || Shell.preferred() - const args = input.args || [] + let args = input.args || [] if (command.endsWith("sh")) { args.push("-l") } + if (process.platform === "win32" && args.length === 0) { + const base = path.win32.basename(command).toLowerCase() + if (base === "cmd.exe" || base === "cmd") { + args = ["/k", "chcp 65001>nul"] + } else if (base === "powershell.exe" || base === "pwsh.exe") { + args = [ + "-NoLogo", + "-NoExit", + "-Command", + "[Console]::OutputEncoding=[Text.UTF8Encoding]::UTF8; [Console]::InputEncoding=[Text.UTF8Encoding]::UTF8", + ] + } + } const cwd = input.cwd || Instance.directory const env = { @@ -108,6 +122,12 @@ export namespace Pty { TERM: "xterm-256color", OPENCODE_TERMINAL: "1", } as Record + if (process.platform === "win32") { + env.LANG = env.LANG || "en_US.UTF-8" + env.LC_ALL = env.LC_ALL || "en_US.UTF-8" + env.PYTHONUTF8 = env.PYTHONUTF8 || "1" + env.PYTHONIOENCODING = env.PYTHONIOENCODING || "utf-8" + } log.info("creating session", { id, cmd: command, args, cwd }) const spawn = await pty()