Repository navigation
fix(server): restore terminal startup on Windows #14097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Quicksaver
wants to merge
2
commits into
pingdotgg:main
from
Quicksaver:fix/windows-terminal-startup
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Windows terminal startup | ||
|
|
||
| **Worktree branch:** `fix/windows-terminal-startup` | ||
|
|
||
| Windows worktree: `E:/Projects/t3code.worktrees/windows-terminal-startup`. | ||
|
|
||
| node-pty 1.2 initializes ConPTY asynchronously and initially reports PID zero. The node-pty adapter waits for its `ready_datapipe` event before returning the process to the terminal manager. This keeps startup snapshots within the existing positive-PID contract without waiting for shell output or polling. An exit before readiness becomes a typed spawn failure. Interruption removes listeners and terminates the pending ConPTY through its agent without waiting for output. Readiness without a positive PID requests termination and fails the spawn. Unix startup keeps its synchronous path. | ||
|
|
||
| The readiness event and immediate cancellation through `_agent.kill()` are node-pty internals outside its public TypeScript interface. Keep these dependencies isolated in the adapter and recheck them when upgrading node-pty. The fix applies to all clients opening terminals on a Windows environment, including remote connections, without changing client or wire contracts. | ||
|
|
||
| Focused regression coverage: | ||
|
|
||
| ```sh | ||
| vp test run apps/server/src/terminal/NodePtyAdapter.test.ts apps/server/src/terminal/Manager.test.ts | ||
| ``` | ||
|
|
||
| Tests cover delayed PID assignment without output, output and exit delivery after startup, early process exit, output-independent interruption cleanup, invalid-PID readiness failure, and existing Windows, Linux, and macOS adapter behavior. | ||
|
|
||
| Windows Browser-panel verification covers command output, multiple terminals, closing a terminal, and reattaching after a page reload. Run the backend without Node's `--watch` mode for this check: node-pty misreads watcher IPC as a process-list response and crashes when closing a terminal. That separate dev-mode issue remains outstanding. |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.