@@ -8,27 +8,30 @@ import { Instance } from "../project/instance"
88import { shell } from "@opencode-ai/util/shell"
99import { lazy } from "@opencode-ai/util/lazy"
1010import { } from "process"
11+ import { Installation } from "@/installation"
1112
1213export 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