[Bug]: Windows integrated terminals fail with environment request error after node-pty upgrade
What happened
On Windows, opening an integrated terminal in T3 Code Nightly shows [terminal] The environment request failed. The terminal panel opens but never shows a usable shell. This persists after updating from 0.0.43-nightly.20260926.2318 to 0.0.43-nightly.20260927.2331 and rebooting.
This blocks running local development hosts from T3 Code. I have to open a separate terminal to start them.
Steps to reproduce
- Install
0.0.43-nightly.20260927.2331on Windows. - Open a project thread and open an integrated terminal (including a second terminal in the right panel).
- The panel displays
[terminal] The environment request failed.
Diagnosis
The local server trace records successful terminal.trySpawn and terminal.openLocked operations, followed by ws.rpc.terminal.attach ending almost immediately. Terminal output logs contain a PowerShell prompt, so the shell starts but the client cannot display its session.
After the node-pty upgrade in #13748, Windows spawn() can initially return PID 0. The terminal manager stores that value in the snapshot. The client contract accepts a positive PID or null, so it rejects the snapshot and shows the generic environment error. This matches the analysis in #13927.
Fix in progress
#13927 waits for a valid Windows PID before the adapter reports a successful spawn. That PR addresses this exact failure. It is still open and is not in Nightly 0.0.43-nightly.20260927.2331.
Confirmed on T3 Code desktop 0.0.43-nightly.20260928.2375 on Windows 11 x64.
Opening the integrated terminal in either the right panel or the drawer displays [terminal] The environment request failed. This occurs in new terminals. The server trace contains eight failed RpcClient.terminal.open calls. The client rejects the terminal response with:
Expected a value greater than 0
at ["value"]["pid"]
The most recent terminal output log contains a PowerShell prompt, indicating that the shell started even though the UI rejected the session. In the matching nightly source, TerminalSessionSnapshot.pid requires a positive integer or null, while the terminal manager copies the PTY process PID into the session. This is consistent with the PID 0 startup race described in #13927.
Investigated with Codex (GPT-6).