fix(pty): use proper process tree cleanup on disposal#5876
Open
anntnzrb wants to merge 1 commit intoanomalyco:devfrom
Open
fix(pty): use proper process tree cleanup on disposal#5876anntnzrb wants to merge 1 commit intoanomalyco:devfrom
anntnzrb wants to merge 1 commit intoanomalyco:devfrom
Conversation
PTY disposal was using process.kill() directly which: - Only sends SIGTERM without SIGKILL escalation - Doesn't kill child processes spawned by the shell - Doesn't handle Windows process trees Added killPtyTree() helper (based on Shell.killTree pattern) that: - Kills the process group (-pid) - Escalates to SIGKILL after 200ms if needed - Uses taskkill /t on Windows for tree kill - Uses Promise.all for parallel cleanup of multiple sessions - Properly catches errors for already-exited processes
This was referenced Dec 21, 2025
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
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.
Summary
killPtyTree()helper for proper PTY process tree cleanupPromise.all()for parallel session cleanup on disposalProblem
PTY disposal was using
process.kill()directly which:Solution
Added
killPtyTree()helper (based onShell.killTreepattern) that:-pid) on Unixtaskkill /ton Windows for tree killRelated: #3057, #5525