Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@xterm/addon-web-links": "^0.11.0",
"@xterm/addon-webgl": "^0.18.0",
"@xterm/xterm": "^5.5.0",
"@zenyr/bun-pty": "^0.4.4",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify all node-pty imports have been updated and check PTY usage location

echo "=== Checking for remaining node-pty imports ==="
rg -n --type=ts --type=tsx "from ['\"]node-pty['\"]|require\(['\"]node-pty['\"]\)" apps/desktop/src/ 2>/dev/null || echo "No results"

echo -e "\n=== Checking new @zenyr/bun-pty imports ==="
rg -n --type=ts --type=tsx "from ['\"]@zenyr/bun-pty['\"]|require\(['\"]@zenyr/bun-pty['\"]\)" apps/desktop/src/ 2>/dev/null || echo "No results"

echo -e "\n=== Checking PTY usage location (should be in main process, not renderer) ==="
rg -n --type=ts --type=tsx -C3 "@zenyr/bun-pty|pty\|IPty" apps/desktop/src/renderer/ 2>/dev/null || echo "No PTY usage in renderer"

echo -e "\n=== Checking for @types/node-pty in package.json ==="
rg -n "@types/node-pty" apps/desktop/package.json 2>/dev/null || echo "Not found"

echo -e "\n=== Checking PTY usage in main process ==="
rg -n --type=ts --type=tsx "@zenyr/bun-pty|pty\|IPty" apps/desktop/src/main/ 2>/dev/null || echo "No results"

Repository: superset-sh/superset

Length of output: 401


🌐 Web query:

@zenyr/bun-pty node-pty drop-in replacement API compatibility

💡 Result:

Short answer: Mostly — @zenyr/bun-pty implements a node-pty–like API (spawn, write, resize, kill, onData/onExit, pid/cols/rows/process) and is intended as a Bun-native replacement, so common node-pty code will often work with little or no changes. [1][2]

Notes / caveats:

  • Method names/shape: bun-pty exposes spawn and an IPty with onData/onExit, write, resize, kill and similar properties — matching the typical node-pty surface. [1][2]
  • Event vs callback style: modern node-pty docs also show onData/onExit APIs (not only EventEmitter), but if your code relies on older event-emitter internals or undocumented behaviors you should test. [2]
  • Options/edge cases: confirm options you use (env, cwd, name, cols/rows, encoding, signal handling) behave identically in your target Bun version; prebuilt binaries and Bun runtime differences may affect behavior. [1]
  • Recommendation: treat it as “mostly drop-in” for typical terminal use, but run your test-suite (or quick smoke tests) for any advanced/edge-case features (signals, custom streams, platforms). If you want, tell me a specific node-pty code sample and I’ll point out required changes/test checklist.

Sources:
[1] @zenyr/bun-pty README (API, types, examples).
[2] node-pty (API / examples).


🏁 Script executed:

#!/bin/bash
# Check all file types for PTY usage

echo "=== Searching all file types for node-pty usage ==="
rg "node-pty" apps/desktop/ 2>/dev/null || echo "No node-pty found"

echo -e "\n=== Searching all file types for @zenyr/bun-pty usage ==="
rg "@zenyr/bun-pty" apps/desktop/ 2>/dev/null || echo "No @zenyr/bun-pty found"

echo -e "\n=== Checking if pty/IPty is used anywhere in codebase ==="
rg "spawn.*pty|IPty|bun-pty" apps/desktop/src/ 2>/dev/null || echo "No PTY usage found"

echo -e "\n=== List all files in apps/desktop/src/main/ ==="
find apps/desktop/src/main -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" \) 2>/dev/null | head -20

Repository: superset-sh/superset

Length of output: 3099


Complete the migration from node-pty to @zenyr/bun-pty across the entire codebase.

The dependency has been added to package.json, but the integration is incomplete. The following files still import and use node-pty:

  • apps/desktop/src/main/lib/terminal/session.ts — imports "node-pty"
  • apps/desktop/src/main/lib/terminal/types.ts — imports "node-pty" for types
  • apps/desktop/src/main/lib/terminal/manager.test.ts — imports and mocks "node-pty"

Additionally, the build and tooling configuration still reference node-pty:

  • apps/desktop/electron-builder.ts — copy rules for node-pty native modules
  • apps/desktop/electron.vite.config.ts — marks node-pty as external
  • apps/desktop/scripts/copy-native-modules.ts — lists node-pty as native module

Update all these files to import @zenyr/bun-pty instead. Verify that the @zenyr/bun-pty API is compatible with existing terminal operations (spawn, IPty interface, write, resize, kill, onData/onExit).

🤖 Prompt for AI Agents
In apps/desktop/package.json around line 68 and across the codebase, the
dependency was added but imports and tooling still reference node-pty; update
all occurrences to @zenyr/bun-pty: replace import "node-pty" with
"@zenyr/bun-pty" in apps/desktop/src/main/lib/terminal/session.ts and
apps/desktop/src/main/lib/terminal/types.ts (adjust type imports to use the
IPty/type names exported by @zenyr/bun-pty), update tests in
apps/desktop/src/main/lib/terminal/manager.test.ts to mock and import
@zenyr/bun-pty, and change build/tooling references in
apps/desktop/electron-builder.ts, apps/desktop/electron.vite.config.ts, and
apps/desktop/scripts/copy-native-modules.ts to reference @zenyr/bun-pty; while
making these changes, ensure API compatibility by mapping any differing method
or event names (spawn, write, resize, kill, onData/onExit or their equivalents)
to the existing terminal usage and update types or small adapters where
necessary so existing code calls continue to work.

"better-sqlite3": "12.5.0",
"bindings": "^1.5.0",
"clsx": "^2.1.1",
Expand All @@ -90,7 +91,6 @@
"monaco-editor": "^0.55.1",
"nanoid": "^5.1.6",
"node-addon-api": "^7.1.0",
"node-pty": "1.1.0-beta30",
"os-locale": "^6.0.2",
"posthog-js": "1.310.1",
"posthog-node": "^5.18.0",
Expand Down
18 changes: 14 additions & 4 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading