summaryrefslogtreecommitdiffhomepage
path: root/packages
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 /packages
parent1c25f1fae03d6bd33c8350c7371a1d6c79114ee1 (diff)
downloadopencode-c131dd08295a0a061fe603bca6d22af53e335e9b.tar.gz
opencode-c131dd08295a0a061fe603bca6d22af53e335e9b.zip
fix(desktop): Windows support for PTY and cross-platform build scripts (#6508)
Diffstat (limited to 'packages')
-rw-r--r--packages/desktop/scripts/predev.ts2
-rw-r--r--packages/opencode/package.json2
-rw-r--r--packages/opencode/src/pty/index.ts21
3 files changed, 3 insertions, 22 deletions
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)}`,