Environment
- DSH Desktop
0.10.0 (macOS arm64, packaged app)
- Bundled Harness
0.1.7-rc.2
- Bundled
node-pty@1.2.0-beta.15
- This happened before installing
dsh-better-sidebar or dsh-remote-ssh, and also reproduces with those plugins bypassed.
Symptom
Opening the built-in terminal reports:
Terminal error: posix_spawn failed: No such file or directory
Root cause / isolated reproduction
The packaged node-pty/lib/unixTerminal.js computes helperPath from native.dir, then applies:
helperPath = helperPath.replace('app.asar', 'app.asar.unpacked');
In this build, node-pty is already under Resources/app.asar.unpacked/node_modules/. This transforms a valid path containing app.asar.unpacked into app.asar.unpacked.unpacked.
With the same native module, /bin/bash, working directory, and environment, passing the computed path to pty.fork gives posix_spawn failed: No such file or directory; passing the actual existing prebuilds/darwin-arm64/spawn-helper path succeeds and returns a PID and FD. This isolates the error to the helper path, not the shell, cwd, or Remote SSH plugin.
// Run using macOS Node against the packaged DSH Desktop node-pty:
const path = require('node:path');
const fs = require('node:fs');
const root = '/Applications/DSH Desktop.app/Contents/Resources/app.asar.unpacked/node_modules/node-pty';
const native = require(root + '/lib/utils.js').loadNativeModule('pty');
const actual = path.resolve(root + '/lib', native.dir + '/spawn-helper');
const computed = actual.replace('app.asar', 'app.asar.unpacked')
.replace('node_modules.asar', 'node_modules.asar.unpacked');
console.log(fs.existsSync(actual), fs.existsSync(computed)); // true false
const args = ['/bin/bash', [], ['TERM=xterm-256color', 'HOME=' + process.env.HOME,
'PATH=/usr/bin:/bin'], process.env.HOME, 80, 24, -1, -1, true];
native.module.fork(...args, computed, () => {}); // ENOENT
// In a separate run: native.module.fork(...args, actual, () => {}) succeeds.
Expected
Opening the native terminal starts a shell. Please avoid re-rewriting app.asar.unpacked (e.g. replace only the exact app.asar/ path segment, or avoid this rewrite when the module is already unpacked), and add a packaged macOS PTY smoke test. No app files were modified during diagnosis.
Environment
0.10.0(macOS arm64, packaged app)0.1.7-rc.2node-pty@1.2.0-beta.15dsh-better-sidebarordsh-remote-ssh, and also reproduces with those plugins bypassed.Symptom
Opening the built-in terminal reports:
Root cause / isolated reproduction
The packaged
node-pty/lib/unixTerminal.jscomputeshelperPathfromnative.dir, then applies:In this build,
node-ptyis already underResources/app.asar.unpacked/node_modules/. This transforms a valid path containingapp.asar.unpackedintoapp.asar.unpacked.unpacked.With the same native module,
/bin/bash, working directory, and environment, passing the computed path topty.forkgivesposix_spawn failed: No such file or directory; passing the actual existingprebuilds/darwin-arm64/spawn-helperpath succeeds and returns a PID and FD. This isolates the error to the helper path, not the shell, cwd, or Remote SSH plugin.Expected
Opening the native terminal starts a shell. Please avoid re-rewriting
app.asar.unpacked(e.g. replace only the exactapp.asar/path segment, or avoid this rewrite when the module is already unpacked), and add a packaged macOS PTY smoke test. No app files were modified during diagnosis.