summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLuke Parker <[email protected]>2026-01-01 11:18:07 +1000
committerGitHub <[email protected]>2025-12-31 19:18:07 -0600
commitc131dd08295a0a061fe603bca6d22af53e335e9b (patch)
tree34282770897a24694d25a509590154d1682e0491
parent1c25f1fae03d6bd33c8350c7371a1d6c79114ee1 (diff)
downloadopencode-c131dd08295a0a061fe603bca6d22af53e335e9b.tar.gz
opencode-c131dd08295a0a061fe603bca6d22af53e335e9b.zip
fix(desktop): Windows support for PTY and cross-platform build scripts (#6508)
-rw-r--r--bun.lock4
-rw-r--r--packages/desktop/scripts/predev.ts2
-rw-r--r--packages/opencode/package.json2
-rw-r--r--packages/opencode/src/pty/index.ts21
4 files changed, 5 insertions, 24 deletions
diff --git a/bun.lock b/bun.lock
index a43b0d145..7fdb50669 100644
--- a/bun.lock
+++ b/bun.lock
@@ -294,7 +294,7 @@
"@zip.js/zip.js": "2.7.62",
"ai": "catalog:",
"bonjour-service": "1.3.0",
- "bun-pty": "0.4.2",
+ "bun-pty": "0.4.4",
"chokidar": "4.0.3",
"clipboardy": "4.0.0",
"decimal.js": "10.5.0",
@@ -2044,7 +2044,7 @@
"bun-ffi-structs": ["[email protected]", "", { "peerDependencies": { "typescript": "^5" } }, "sha512-Lh1oQAYHDcnesJauieA4UNkWGXY9hYck7OA5IaRwE3Bp6K2F2pJSNYqq+hIy7P3uOvo3km3oxS8304g5gDMl/w=="],
- "bun-pty": ["[email protected]", "", {}, "sha512-sHImDz6pJDsHAroYpC9ouKVgOyqZ7FP3N+stX5IdMddHve3rf9LIZBDomQcXrACQ7sQDNuwZQHG8BKR7w8krkQ=="],
+ "bun-pty": ["[email protected]", "", {}, "sha512-WK4G6uWsZgu1v4hKIlw6G1q2AOf8Rbga2Yr7RnxArVjjyb+mtVa/CFc9GOJf+OYSJSH8k7LonAtQOVeNAddRyg=="],
"bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-5ua817+BZPZOlNaRgGBpZJOSAQ9RQ17pkwPD0yR7CfJg+r8DgIILByFifDTa+IPDDxzf5VNhtNlcKqFzDgJvlQ=="],
diff --git a/packages/desktop/scripts/predev.ts b/packages/desktop/scripts/predev.ts
index 218215197..3d0cd5e92 100644
--- a/packages/desktop/scripts/predev.ts
+++ b/packages/desktop/scripts/predev.ts
@@ -6,7 +6,7 @@ const RUST_TARGET = Bun.env.TAURI_ENV_TARGET_TRIPLE
const sidecarConfig = getCurrentSidecar(RUST_TARGET)
-const binaryPath = `../opencode/dist/${sidecarConfig.ocBinary}/bin/opencode`
+const binaryPath = `../opencode/dist/${sidecarConfig.ocBinary}/bin/opencode${process.platform === "win32" ? ".exe" : ""}`
await $`cd ../opencode && bun run build --single`
diff --git a/packages/opencode/package.json b/packages/opencode/package.json
index 5c76005bf..0cac20190 100644
--- a/packages/opencode/package.json
+++ b/packages/opencode/package.json
@@ -89,7 +89,7 @@
"@zip.js/zip.js": "2.7.62",
"ai": "catalog:",
"bonjour-service": "1.3.0",
- "bun-pty": "0.4.2",
+ "bun-pty": "0.4.4",
"chokidar": "4.0.3",
"clipboardy": "4.0.0",
"decimal.js": "10.5.0",
diff --git a/packages/opencode/src/pty/index.ts b/packages/opencode/src/pty/index.ts
index 5ea479c63..afc6a78da 100644
--- a/packages/opencode/src/pty/index.ts
+++ b/packages/opencode/src/pty/index.ts
@@ -7,32 +7,12 @@ import { Log } from "../util/log"
import type { WSContext } from "hono/ws"
import { Instance } from "../project/instance"
import { lazy } from "@opencode-ai/util/lazy"
-import {} from "process"
-import { Installation } from "@/installation"
import { Shell } from "@/shell/shell"
export namespace Pty {
const log = Log.create({ service: "pty" })
const pty = lazy(async () => {
- if (!Installation.isLocal()) {
- const path = require(
- `bun-pty/rust-pty/target/release/${
- process.platform === "win32"
- ? "rust_pty.dll"
- : process.platform === "linux" && process.arch === "x64"
- ? "librust_pty.so"
- : process.platform === "darwin" && process.arch === "x64"
- ? "librust_pty.dylib"
- : process.platform === "darwin" && process.arch === "arm64"
- ? "librust_pty_arm64.dylib"
- : process.platform === "linux" && process.arch === "arm64"
- ? "librust_pty_arm64.so"
- : ""
- }`,
- )
- process.env.BUN_PTY_LIB = path
- }
const { spawn } = await import("bun-pty")
return spawn
})
@@ -128,6 +108,7 @@ export namespace Pty {
cwd,
env,
})
+
const info = {
id,
title: input.title || `Terminal ${id.slice(-4)}`,