fix(web): terminate Windows PTYs without unsupported signals - #605
Merged
tt-a1i merged 3 commits intoSep 22, 2026
Merged
Conversation
tt-a1i
approved these changes
Sep 22, 2026
tt-a1i
left a comment
Collaborator
There was a problem hiding this comment.
复审提交 819d790083cccee8ff662e1a318598c6b32fb480。
未发现阻断问题。Windows 路径改为 ConPTY 支持的无信号 pty.kill(),并只在 POSIX 保留延迟 SIGKILL 升级;close、retain、dispose 的 fake PTY 用例和原生 Windows PTY 退出用例覆盖了各条清理路径。当前 Node、Web E2E 和原生 Windows 检查均通过。
验证边界:没有重新执行长期运行的真实交互终端压力测试;结论覆盖本 PR 的两文件生命周期变化。
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.
Problem
On Windows, node-pty terminates through ConPTY and rejects POSIX signal arguments. The Web interactive terminal manager passed
SIGKILLon force cleanup, and scheduled a POSIX force-kill fallback after normal cleanup.Value
Windows Web terminals can close, be retained, and be disposed without throwing from node-pty. This prevents terminal lifecycle cleanup from failing on Windows while preserving the existing POSIX escalation behavior.
Approach
Use signal-free
pty.kill()on Windows and keep the existingSIGKILLescalation only on non-Windows platforms. Add Windows-specific fake-PTY coverage for close, retain, and dispose, plus a native Windows PTY exit test.Validation
bun run checkpassed.node --experimental-strip-types --test tests/web/interactive-terminal.test.ts: 7/7 passed on Windows.git diff --checkpassed.bun run testwas not rerun for this isolated two-file change; the repository baseline has unrelated post-edit lifecycle failures documented in PR fix(setup): recover locks while writers wait #604.Impact