Skip to content

Terminal leaks processes #26807

Closed
Closed

Description

  • VSCode Version: 1.13 insider
  • OS Version: Windows

Steps to Reproduce:

  1. clone vscode-eslint repository
  2. chdir to eslint/eslint-server
  3. open terminal (I use powershell as the terminal, not sure if it matters)
  4. type npm install
  5. type npm run watch
  6. Kill the terminal by pressing the garbage bin button

Open a process explorer

Observe: there are still two process orphaned conhost.exe and node.exe

capture

Activity

  1. added
    bug
    important
    terminal
    on May 17, 2017
  2. dbaeumer commented on May 17, 2017

    @dbaeumer
    MemberAuthor

    This also affects the task runner when using the terminal as the execution engine

  3. dbaeumer commented on May 17, 2017

    @dbaeumer
    MemberAuthor

    Executing this natively in a PowerShell command prompt and using Ctrl+C to interrupt the process works as expected.

  4. dbaeumer commented on May 17, 2017

    @dbaeumer
    MemberAuthor

    Using node version 6.5.0 but happens with 7.10.0 for me as well.

  5. dbaeumer commented on May 18, 2017

    @dbaeumer
    MemberAuthor

    I just noticed that this also happens in Hyper.js. Looks like something has changed how winpty-agent launches processes.

  6. Tyriar commented on May 19, 2017

    @Tyriar
    Contributor

    Related: #26897

  7. added
    windows
    on May 19, 2017
  8. Tyriar commented on May 25, 2017

    @Tyriar
    Contributor

    I actually can't reproduce using your steps on:

    • VSCode Version: Code - Insiders 1.13.0-insider (7403245, 2017-05-23T05:14:19.493Z)
    • OS Version: Windows_NT ia32 10.0.14393

    I tried 3 times and every time both node and conhost processes are terminated after around 5 seconds max which is consistent with the code https://github.com/Microsoft/vscode/blob/f95866f07eaf1cdea610479a11778ae82f69bf4b/src/vs/workbench/parts/terminal/node/terminalProcess.ts#L129

    Any more info on a repro would be good. What version of Windows are you on?

  9. added
    info-needed
    and removed
    important
    on May 25, 2017
  10. 68 remaining items

  11. the-ress commented on Sep 8, 2017

    @the-ress
    Contributor

    Daniel Imms (@Tyriar) no, it's still WIP/PoC. Yes, of course you can.

  12. the-ress commented on Sep 16, 2017

    @the-ress
    Contributor

    Created rprichard/winpty#130 with winpty part of the changes.

  13. Tyriar commented on Oct 3, 2017

    @Tyriar
    Contributor

    Tereza Tomcova (@the-ress) just tested your winpty patch and it correctly returns the process list without the notepad process launched via start notepad 👍

  14. Tyriar commented on Oct 3, 2017

    @Tyriar
    Contributor

    Thanks to Tereza Tomcova (@the-ress) this is now fixed at the node-pty level. 🎉

    Tereza Tomcova (@the-ress) when the winpty PR is finalized I'll pull the latest code into the next version of node-pty.

  15. edongashi commented on Oct 15, 2017

    @edongashi

    I am experiencing this issue on win 10 x64.

    Version 1.17.1
    Commit 1e9d36539b0ae51ac09b9d4673ebea4e447e5353
    Date 2017-10-10T14:24:50.851Z
    Shell 1.7.7
    Renderer 58.0.3029.110
    Node 7.9.0
    Architecture x64
    

    node.exe gets orphaned when using npm run *** and closing vs code.

    Tested with git bash and ps as terminal.

  16. Tyriar commented on Oct 18, 2017

    @Tyriar
    Contributor

    Edon Gashi (@edongashi) the fix for this will be out in v1.18, you can try it out now in the Insiders build https://code.visualstudio.com/insiders

  17. edongashi commented on Oct 19, 2017

    @edongashi

    Tried it. It's working as expected. Thanks!

  18. Beretta1979 commented on Nov 13, 2017

    @Beretta1979

    For me this is still occurring on for version 1.18 on Windows 10 with node js. If I kill the terminal using the garbage bin button the node processes are killed correctly. If VS Code is closed the processes keep running.

  19. TomasHubelbauer commented on Nov 13, 2017

    @TomasHubelbauer
    Contributor

    Sébastien Van Bruaene (@Beretta1979) I am on Windows 10 and VS Code 1.18.0 and the integrated terminal I am using is cmd.exe. I used an external PowerShell terminal and did tasklist -fi "imagename eq node.exe" after doing npm start and closing using the bin button and after doing npm start and closing VS Code as a whole and in my case it worked as it should have. What is in your terminal.integrated.shell.windows setting?

  20. Beretta1979 commented on Nov 13, 2017

    @Beretta1979

    Tomáš Hübelbauer (@TomasHubelbauer) I tested this both with terminal.integrated.shell.windows set to powershell (default) as with cmd.exe

  21. locked and limited conversation to collaborators on Nov 17, 2017
  22. added 2 commits that reference this issue on Sep 6, 2026
    a4abe93
    ebae2d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugterminalupstreamverifiedwindows

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions