rprichard / winpty

A Windows software package providing an interface similar to a Unix pty-master for communicating with Windows console programs.
MIT License
1.3k stars 166 forks source link

winpty leaks processes #129

Open Tyriar opened 7 years ago

Tyriar commented 7 years ago

Forked from https://github.com/Microsoft/vscode/issues/26807, node servers in particular don't get killed when killing the winpty agent. Grabbing the process list via GetConsoleProcessList and killing them manually in winpty is probably the right solution.

rprichard commented 7 years ago

Thanks for filing the issue. I don't know when I'll get around to working on this issue, but it's probably something that should be fixed (or at least improved).

Comments:

Possible solution:

winpty can determine whether the console process order is in correct order or reversed order by looking for its own PID in the process list.

Sader82 commented 7 years ago

Is there a solution already? I'm running the latest version of vscode and powershell module, and still have the leaking process issue image

Tyriar commented 7 years ago

@Sader82 the problem is fixed in the latest insiders by making use of https://github.com/rprichard/winpty/pull/130

I'm not sure what you're seeing but it's different to the leaking processes problem, where processes would be orphaned (no longer descendants of the Code.exe tree) and continue running.

Sader82 commented 7 years ago

@Tyriar this happends when the integrated terminal for powershell is active. killing the terminal stops cloning (leaking) the process.

Perhaps it is fixed in the new version. I do not run ths insider build..