Skip to content

feat(runtime): let a project's desktop app open terminals of its own - #63

Merged
winlp4ever merged 2 commits into
epic/electron-targetsfrom
feat/electron-real-apps
Oct 11, 2026
Merged

winlp4ever merged 2 commits into
epic/electron-targetsfrom
feat/electron-real-apps

Conversation

@winlp4ever

@winlp4ever winlp4ever commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

PR 5 of the Electron targets epic: the real-app pass. First finding, fixed here.

What the minmux run found

  • Confined minmux could start no shell ("posix_spawnp failed"): Seatbelt denied /dev/ptmx.
  • The old rule let any confined app print into every terminal the user had open (measured; typing into it was refused by macOS).

What changes (user decision: terminals per app, opt-in)

  • No desktop app reaches a terminal unless its project says terminals: true: ticked on the add card, which warns what it exposes, and covered by the app's approval (a project that turns it on is asked again; the card for an app the project already names shows it).
  • Such a launch lists the user's ptys open just before it starts and denies each every way (read, write, stat, chmod, ioctl, revoke), allowing new ones; free ptys' leftover nodes (root's) aren't listed. Its profile is checked to load first.
  • Its shells get a neutral prompt (~ %): no login or Mac name on camera (user decision).
  • Stated gaps (BACKLOG, FAILURE-CATALOGUE feat(compositor): move the camera over the whole picture #24): a terminal the user opens while it runs is exposed to it; closing one open at launch can break the app's next pane; checks run without terminals.
  • Driver: --desktop, --desktop-arg, --files, --desktop-terminals.

Verified

  • Kif on confined minmux: typed echo hello from minmux, ran it, recorded and exported; the video shows the output and the neutral prompt.
  • Tests fail with each hole put back (old tty rule, unlisted terminals, no ptmx, write-data only, no stat deny, root-owned listed, no neutral shell, digest without terminals, card without warning, launch dropping it).
  • Design reviewed twice; two /code-review high rounds.

Follow-ups: the VS Code pass's safe fixes in #64 (stacked on this one); clicks with DevTools open, splash timings and handover on the fixture in their own PR.

A confined app could make no pty (terminal apps failed with posix_spawnp),
and could print into every terminal the user had open. Now no app reaches a
terminal unless its project says terminals: true, ticked on its add card with
a warning and covered by its approval. Such a launch denies the user's ptys
open at launch every way (read, write, stat, chmod, ioctl, revoke), allows
new ones, and gives its shells a neutral prompt. A terminal the user opens
while it runs stays exposed (stated in BACKLOG).
--desktop name=/path/App.app adds it through the Apps panel (picked, checked
confined, allowed), with --desktop-arg, --files and --desktop-terminals.
@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 26.08696% with 34 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/runtime/src/electron-confine.ts 10.00% 18 Missing ⚠️
packages/runtime/src/electron.ts 0.00% 13 Missing and 2 partials ⚠️
apps/desktop/src/main/index.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@winlp4ever
winlp4ever marked this pull request as ready for review October 11, 2026 19:26
@winlp4ever
winlp4ever merged commit bdcb782 into epic/electron-targets Oct 11, 2026
4 of 5 checks passed
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