fix(server): restore Windows terminal startup after node-pty upgrade - #1
Merged
Merged
Conversation
SegFaultZero
commented
Sep 27, 2026
SegFaultZero
marked this pull request as ready for review
September 27, 2026 06:12
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.
What Changed
Wait for a valid Windows terminal PID before completing the node-pty adapter's spawn operation. This restores terminal startup after the node-pty upgrade; the terminal manager keeps storing the PID once, and Unix startup is unchanged.
The adapter uses node-pty's private
ready_datapipeevent, validates the PID, and removes listeners on completion or interruption. Startup failures are reported asPtySpawnError. Cancellation uses the internal Windows agent because publickill()waits for first output. Comments link the upstream changes that require these compatibility hooks.Why
Terminals on Windows are broken after the node-pty upgrade: opening a terminal displays "[terminal] The environment request failed." instead of a usable shell.
After pingdotgg#13748 upgraded node-pty from 1.1.0 to 1.2.0-beta.15, Windows spawn initially returns PID

0while process creation is still pending. T3 immediately stored that startup value and never refreshed it when node-pty assigned the real PID. Clients rejected the resulting terminal snapshots because the contract accepts only a positive PID ornull, displaying "[terminal] The environment request failed."microsoft/node-pty#885 deferred Windows process creation to avoid blocking on named pipes. Waiting for its internal readiness event handles silent processes without polling or waiting for shell output. The private API dependency is confined to the adapter.
Validation
vp test run src/terminal/NodePtyAdapter.test.ts src/terminal/Manager.test.tsfromapps/server.vp run build:desktopsucceeded on Windows.Implemented with GPT-6-Astra through the Codex harness.