summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-12-05 10:39:44 -0500
committerDax Raad <[email protected]>2025-12-05 10:39:44 -0500
commit60388f7f03d26c272a1695f61af950648a2f8658 (patch)
treeb2926f2023e1cb0859eb941bf6bc601e85dd1cd2
parent53ed1c912bda7a39f60c09968d41b109dfc913de (diff)
downloadopencode-60388f7f03d26c272a1695f61af950648a2f8658.tar.gz
opencode-60388f7f03d26c272a1695f61af950648a2f8658.zip
do not use required pty for local dev
-rw-r--r--packages/opencode/src/pty/index.ts35
1 files changed, 19 insertions, 16 deletions
diff --git a/packages/opencode/src/pty/index.ts b/packages/opencode/src/pty/index.ts
index 4109a0975..d03c697b8 100644
--- a/packages/opencode/src/pty/index.ts
+++ b/packages/opencode/src/pty/index.ts
@@ -8,27 +8,30 @@ import { Instance } from "../project/instance"
import { shell } from "@opencode-ai/util/shell"
import { lazy } from "@opencode-ai/util/lazy"
import {} from "process"
+import { Installation } from "@/installation"
export namespace Pty {
const log = Log.create({ service: "pty" })
const pty = lazy(async () => {
- 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
+ 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
})