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" +} 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 {} 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 {} 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()