Follow-on from the ttysnap arc. The shared pty module (src/ttysnap/pty.zig) is POSIX-only: it uses posix_openpt/grantpt/unlockpt/ptsname/fork/execvpe + TIOCSCTTY/dup2. To drive terminal programs on Windows, ttysnap (and by extension the e2e harness once converged) needs a ConPTY backend.
Sketch:
- Add a Windows branch to
pty.spawn (or a pty_windows.zig selected by @import("builtin").os.tag): CreatePseudoConsole (ConPTY) + CreateProcessW with PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE, returning the read/write pipe handles in place of the master fd.
Child abstracts the handle vs fd; setSize → ResizePseudoConsole.
- The pump (
poll/non-blocking read) needs a Windows equivalent (overlapped I/O or a reader thread).
Deferred deliberately: cannot be built/runtime-tested on the Linux dev box (no way to verify ConPTY behavior), so it would land unverified. Pick up when a Windows test path exists.
Follow-on from the ttysnap arc. The shared
ptymodule (src/ttysnap/pty.zig) is POSIX-only: it usesposix_openpt/grantpt/unlockpt/ptsname/fork/execvpe+TIOCSCTTY/dup2. To drive terminal programs on Windows, ttysnap (and by extension the e2e harness once converged) needs a ConPTY backend.Sketch:
pty.spawn(or apty_windows.zigselected by@import("builtin").os.tag):CreatePseudoConsole(ConPTY) +CreateProcessWwithPROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE, returning the read/write pipe handles in place of the master fd.Childabstracts the handle vs fd;setSize→ResizePseudoConsole.poll/non-blocking read) needs a Windows equivalent (overlapped I/O or a reader thread).Deferred deliberately: cannot be built/runtime-tested on the Linux dev box (no way to verify ConPTY behavior), so it would land unverified. Pick up when a Windows test path exists.