Skip to content

fix(execution): provide host_tty.isatty/get_size + real set_raw_mode for wasm-c TTY guests#167

Merged
NathanFlurry merged 1 commit into
mainfrom
nathan/wasm-host-tty-bridge
Jul 1, 2026
Merged

fix(execution): provide host_tty.isatty/get_size + real set_raw_mode for wasm-c TTY guests#167
NathanFlurry merged 1 commit into
mainfrom
nathan/wasm-host-tty-bridge

Conversation

@NathanFlurry

Copy link
Copy Markdown
Member

Fixes wasm-c TTY guests (pty_probe, vim) that couldn't run under the converged runtime.

crates/execution/assets/runners/wasm-runner.mjs's host_tty import object only provided read() and a stubbed set_raw_mode that returned 0 — it was missing isatty and get_size. Any wasm-c program that imports host_tty.{isatty,get_size} (the "termios bridge" — used by pty_probe, vim, and any crossterm/termios guest) therefore failed to instantiate with a LinkError on the missing imports, produced no output, and hung.

This wires all three to the kernel sync-RPCs that already exist and are served on the same dispatch as the working __kernel_stdin_read:

  • isatty(fd)__kernel_isatty
  • get_size(fd, colsPtr, rowsPtr)__kernel_tty_size (writes two LE u16s)
  • set_raw_mode(enabled)__pty_set_raw_mode (was a no-op stub)

Root-caused by debugging the recovered pty-line-discipline integration test (agent-os), whose wasm-c matrix all timed out with an empty screen because the probe never instantiated. Complements secure-exec#166 (kernel line-editing): #166 made the kernel do echo/VKILL/VWERASE; this makes the guest able to reach it.

…for wasm-c TTY guests

wasm-runner.mjs's host_tty import only provided read() + a stubbed set_raw_mode,
missing isatty/get_size — so any wasm-c program importing host_tty.{isatty,get_size}
(pty_probe, vim) failed to instantiate (LinkError) and produced no output. Wire all
three to the existing kernel sync-RPCs (__kernel_isatty / __kernel_tty_size /
__pty_set_raw_mode) already served on the same dispatch as __kernel_stdin_read.
@railway-app railway-app Bot temporarily deployed to secure-exec / secure-exec-pr-167 July 1, 2026 21:18 Destroyed
@NathanFlurry NathanFlurry merged commit 505d93f into main Jul 1, 2026
1 of 2 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