Follow-up to #66, #501 and #502. A wider unchanged subprocess audit selected three cases from test/js/bun/terminal/terminal-spawn.test.ts: data callbacks, stdout TTY detection, and inline terminal creation. Native Home reports 0 pass / 3 fail / 13 filtered out. Existing Terminal instances fail with terminal slave fd is no longer valid; inline creation returns PTY not supported on this platform on Darwin. Published a21f735fc produces the same failures, so these predate the input/kevent fixes.
packages/runtime/src/runtime/api/bun/terminal.zig still provides skeleton state and methods: createFromSpawn always returns NotSupported, ref/unref return undefined, and close/dispose primarily flip flags. Port the real current native terminal implementation: PTY creation and ownership, terminal reader/writer, callback delivery, process attachment, terminal modes/resize, ref/unref and idempotent asynchronous cleanup. An object with plausible fields or success-shaped no-ops is not the required capability.
Preserve original tests and deadlines. Validate standalone and inline terminal instances, actual TTY behavior and bytes, and the already-removed FilePoll semantics from #501. Include input payloads overridden by terminal stdio (#502) and resource/lifetime checks. Platform guards must remain honest; Darwin execution is available locally, while other platforms require distinct verification.
Installed Bun 1.3.14 passes only the inline case in this three-case control (1 pass / 2 timeout failures / 5 assertions); it is not a passing control for the whole newer selection. The pinned source and unchanged tests remain the target: 4982b91e3702094330f3be3883354c52b8c01323. Package-script dispatch remains separate in #497; ordinary spawn and stream behavior must not be conflated with terminal support.