You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ConPTY kill path leaks the conin socket, one handle per pty #947
On Windows with ConPTY (useConpty: true, useConptyDll: false), each pty leaks one PipeWrap handle for its lifetime of the host process. The conin socket is never destroyed.
The ConPTY DLL path a few lines away does destroy it, so this looks like an asymmetry rather than a deliberate design.
Where
lib/windowsPtyAgent.js, in kill().
The useConpty && !useConptyDll branch marks both sockets unreadable and disposes the conout worker:
_inSocket.destroy() is never called on the first path.
Reproduction
node-pty 1.1.0, Node 26.0.0, Windows 11 Pro 26200 x64.
Spawn N ptys, wait for each to be ready, kill it, wait for exit, then count PipeWrap entries from process.getActiveResourcesInfo() after things settle.
The remaining two are the last session still settling.
Impact
For a short-lived process this is invisible. For a long-running host that spawns and disposes ptys repeatedly, which is our case, it accumulates without bound.
Activity