Skip to content

Commit 16fa272

Browse files
authored
fix: use prebuild binaries for node-pty (#624)
1 parent 31680dd commit 16fa272

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"access": "public"
1717
},
1818
"scripts": {
19-
"postinstall": "npx @electron/rebuild -f -m node_modules/node-pty",
2019
"dev": "make dev",
2120
"prebuild:main": "./scripts/generate-version.sh",
2221
"build": "make build",
@@ -73,7 +72,7 @@
7372
"minimist": "^1.2.8",
7473
"motion": "^12.23.24",
7574
"ollama-ai-provider-v2": "^1.5.4",
76-
"node-pty": "1.1.0-beta39",
75+
"@homebridge/node-pty-prebuilt-multiarch": "^0.11.14",
7776
"rehype-harden": "^1.1.5",
7877
"shescape": "^2.1.6",
7978
"source-map-support": "^0.5.21",
@@ -171,6 +170,7 @@
171170
"dist/**/*.json",
172171
"dist/**/*.png",
173172
"dist/assets/**/*",
173+
"scripts/postinstall.sh",
174174
"README.md",
175175
"LICENSE"
176176
],

src/services/ptyService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { log } from "@/services/log";
99
import type { Runtime } from "@/runtime/Runtime";
1010
import type { TerminalSession, TerminalCreateParams, TerminalResizeParams } from "@/types/terminal";
11-
import type { IPty } from "node-pty";
11+
import type { IPty } from "@homebridge/node-pty-prebuilt-multiarch";
1212
import { SSHRuntime, type SSHRuntimeConfig } from "@/runtime/SSHRuntime";
1313
import { LocalRuntime } from "@/runtime/LocalRuntime";
1414
import { access } from "fs/promises";
@@ -98,10 +98,10 @@ export class PTYService {
9898
if (runtime instanceof LocalRuntime) {
9999
// Local: Use node-pty (dynamically import to avoid crash if not available)
100100
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
101-
let pty: typeof import("node-pty");
101+
let pty: typeof import("@homebridge/node-pty-prebuilt-multiarch");
102102
try {
103103
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment
104-
pty = require("node-pty");
104+
pty = require("@homebridge/node-pty-prebuilt-multiarch");
105105
} catch (err) {
106106
log.error("node-pty not available - local terminals will not work:", err);
107107
throw new Error(
@@ -206,10 +206,10 @@ export class PTYService {
206206

207207
// Load node-pty dynamically
208208
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
209-
let pty: typeof import("node-pty");
209+
let pty: typeof import("@homebridge/node-pty-prebuilt-multiarch");
210210
try {
211211
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment
212-
pty = require("node-pty");
212+
pty = require("@homebridge/node-pty-prebuilt-multiarch");
213213
} catch (err) {
214214
log.error("node-pty not available - SSH terminals will not work:", err);
215215
throw new Error(

0 commit comments

Comments
 (0)