Repository navigation
feat(host): the Rust host on Windows (#76 phase 3b) - #154
Merged
Merged
Conversation
- pty: a ConPTY spawn of our own on Windows (windows-sys): portable-pty quotes every argument, and an npm .cmd CLI arrives as a ready `cmd.exe /d /s /c "…"` line. File and list args are quoted as CreateProcess reads them, a ready line is kept as is; stdio is cut off from the host's log (STARTF_USESTDHANDLES); the exit code comes from the process handle (no signals, like node-pty); kill closes the console, then `taskkill /T /F` after the grace. Unix keeps portable-pty + waitpid - main: a named pipe server (one instance per client, remote clients refused), lock liveness via OpenProcess, token from BCryptGenRandom, a Ctrl-C hook that can't be set never stops the host; the ssh bridge and its plan stay Unix-only - server: accept takes any AsyncRead + AsyncWrite stream - tests/smoke.rs: the built host end to end on every OS (socket or pipe, a pane that prints, one typed into, shutdown); CI's Windows job runs it with clippy - app: finds wraithgrid-host.exe; dist:win builds and bundles it; the Settings switch shows on every OS Refs #76 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3b of #76: the Rust pty host on Windows. With 3a (#153) it now builds for all three systems.
Panes: a ConPTY spawn of our own (
host-rs/src/pty.rs,windows-sys)portable-pty always quotes every argument on Windows, and an npm
.cmdCLI (claude on Windows) arrives as a readycmd.exe /d /s /c "…"line fromplatform.ts, so it couldn't go through portable-pty.STARTF_USESTDHANDLES; otherwise it would inherit those instead of the pseudoconsole.taskkill /PID … /T /Fafter the 2 s grace, as the Node host's Windows policy does.cfg(unix).Host (
main.rs,server.rs)OpenProcess, token fromBCryptGenRandom. A Ctrl-C hook that can't be set (the host has no console) never stops the host.Host::accepttakes any async stream. The ssh bridge and its plan stay Unix-only (remote machines run Linux).App / packaging: finds
wraithgrid-host.exe;dist:winbuilds and bundles it; Settings → Advanced "Use the Rust host" shows on every OS (still off by default).Tests
host-rs/tests/smoke.rs: starts the built host as the GUI does, connects over its socket (named pipe on Windows), runs a pane that prints and one that is typed into, then shuts the host down. On Windows it uses a readycmd.exe /d /s /c "echo …"line, so it covers the ConPTY spawn, the raw command line and the pipe.cargo clippyandcargo test(incl. the smoke test). The parity suite (tests/host) stays Unix-only.cargo clippy -D warningsclean for Linux andx86_64-pc-windows-gnu,cargo test(19 + smoke), parity suite 40 passed, typecheck, lint, 491 unit tests.Not done / not seen: never run in the real app on Windows, nor with a real npm
claude.cmd; the Windows code is checked only by CI's smoke test. No code signing for the binary.Refs #76
🤖 Generated with Claude Code