Skip to content

Commit 60388f7

Browse files
committed
do not use required pty for local dev
1 parent 53ed1c9 commit 60388f7

1 file changed

Lines changed: 19 additions & 16 deletions

File tree

packages/opencode/src/pty/index.ts

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,30 @@ import { Instance } from "../project/instance"
88
import { shell } from "@opencode-ai/util/shell"
99
import { lazy } from "@opencode-ai/util/lazy"
1010
import {} from "process"
11+
import { Installation } from "@/installation"
1112

1213
export namespace Pty {
1314
const log = Log.create({ service: "pty" })
1415

1516
const pty = lazy(async () => {
16-
const path = require(
17-
`bun-pty/rust-pty/target/release/${
18-
process.platform === "win32"
19-
? "rust_pty.dll"
20-
: process.platform === "linux" && process.arch === "x64"
21-
? "librust_pty.so"
22-
: process.platform === "darwin" && process.arch === "x64"
23-
? "librust_pty.dylib"
24-
: process.platform === "darwin" && process.arch === "arm64"
25-
? "librust_pty_arm64.dylib"
26-
: process.platform === "linux" && process.arch === "arm64"
27-
? "librust_pty_arm64.so"
28-
: ""
29-
}`,
30-
)
31-
process.env.BUN_PTY_LIB = path
17+
if (!Installation.isLocal()) {
18+
const path = require(
19+
`bun-pty/rust-pty/target/release/${
20+
process.platform === "win32"
21+
? "rust_pty.dll"
22+
: process.platform === "linux" && process.arch === "x64"
23+
? "librust_pty.so"
24+
: process.platform === "darwin" && process.arch === "x64"
25+
? "librust_pty.dylib"
26+
: process.platform === "darwin" && process.arch === "arm64"
27+
? "librust_pty_arm64.dylib"
28+
: process.platform === "linux" && process.arch === "arm64"
29+
? "librust_pty_arm64.so"
30+
: ""
31+
}`,
32+
)
33+
process.env.BUN_PTY_LIB = path
34+
}
3235
const { spawn } = await import("bun-pty")
3336
return spawn
3437
})

0 commit comments

Comments
 (0)