Skip to content

fix(desktop): repair terminal shell spawning on macOS#3

Merged
gu87 merged 1 commit into
upstream-main-cleanfrom
codex/desktop-terminal-spawn-fix-clean
Jun 6, 2026
Merged

fix(desktop): repair terminal shell spawning on macOS#3
gu87 merged 1 commit into
upstream-main-cleanfrom
codex/desktop-terminal-spawn-fix-clean

Conversation

@gu87

@gu87 gu87 commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes Electron Desktop terminal startup on macOS by ensuring node-pty's prebuilt spawn-helper has executable permissions and by hardening shell resolution.

The failure appeared as posix_spawnp failed when starting the desktop terminal. The root cause was that the node-pty prebuild spawn-helper binary was unpacked without executable permissions after npm ci.

What Changed

  • Ensure node-pty spawn-helper prebuilds are executable before terminal startup.
  • Extract shell resolution into apps/desktop/electron/terminal-shell.cjs.
  • Prefer a valid absolute shell path from SHELL, falling back to macOS shell defaults.
  • Add terminal startup diagnostics for shell path, cwd, env, platform, and file mode.
  • Add tests for valid shell selection, invalid shell fallback, and executable absolute-path resolution.

Validation

  • npm run type-check --workspace apps/desktop — PASS
  • npm run build --workspace apps/desktop — PASS
  • npm run test:desktop:platforms --workspace apps/desktop — 79 PASS
  • node --test apps/desktop/electron/terminal-shell.test.cjs — 13 PASS
  • Electron dev restart: posix_spawnp failed no longer appears

Scope

  • Desktop terminal startup only.
  • No API timeout changes.
  • No OpenRouter/proxy changes.
  • No Browser Workspace / executors / Kanban changes.

Ensure node-pty spawn-helper prebuilds have executable permissions, harden shell resolution with macOS fallbacks, and add terminal startup diagnostics.

Extract shell resolution into a testable helper and cover valid SHELL, invalid SHELL fallback, and absolute executable shell selection.
@gu87 gu87 merged commit 370d1bd into upstream-main-clean Jun 6, 2026
7 checks passed
@gu87 gu87 deleted the codex/desktop-terminal-spawn-fix-clean branch June 6, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant