- five stories status: done; 00-story records the one-run landing - spec History: three implementation amendments (Signal record not scalar, caller-owned stdio fds, handler-latch instead of signalfd) - board NEXT PLAN entry with measured findings (zero transport code added; the tty-across-the-socket handover proven; the double-raw refusal restoring the terminal — the "bug" that was the design working); section rows flipped; graph nodes green - CODE-LOGIC.md: the runtime-v2 section - full belt quoted on the board: suites 0 fail both flavors (test_proc 193/0, test_term 60/0), woc 557/0, subprocess 12/0, site 23/0 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit bc1b4f070693eb755ad6a9fd0c853fb3e2bda347)
1.9 KiB
1.9 KiB
| track | iteration | status | readiness |
|---|---|---|---|
| runtime-v2 | 2 | done | ready |
runtime-v2 2 — PTY: a child that believes it owns a terminal
Part of Story — runtime-v2: the runtime beyond sockets. After 1: a streaming child whose stdio is a pseudo-terminal instead of pipes. A shell run over pipes disables its prompt, its line editing and its job control; a multiplexer is pointless without them.
The problem. Nothing can allocate a PTY pair, place the child on the slave side as its controlling terminal, or resize it. The reference reading is
.dev/reference/tmuxspawn.c+compat/fdforkpty.c(~450 lines of C covering five platforms; Linux alone is far smaller).
Info — the forks, settled (brainstorm 2026-09-01; spec:
2026-09-01-runtime-v2-design.md)
- Separate verb:
proc.spawn_pty(cmd, args, cols, rows) -> ?Child— its own builtin id (static arity table stays static), same Child record withinandoutboth the master fd,errnil. - Resize ships HERE:
proc.resize(id, cols, rows)→ TIOCSWINSZ on the slot; refusal by name on a pipe child. - Transport settled by iteration 1's pull decision — the master fd is driven by the existing net verbs, nothing new.
- Master raw by default, no knobs — until a consumer asks by name.
(
openptymay need-lutil— the plan verifies the link line before assuming.)
Acceptance sketch
- A real shell spawned on a PTY prints a PROMPT (it never does over pipes) — asserted on the bytes.
- Resize: the child (a script reading TIOCGWINSZ) observes the new size.
isattyinside the child answers yes on all three fds.- Kill/reap/stop legs identical to 1's, PTY edition; fd count flat.
Consumers
wmux 1 (every pane), the alacritty study's stage A (the headless expect-clone is exactly "spawn on a PTY, script it, assert").