Skip to content

Terminal API to get child process IDs #46737

Closed

Description

@Tyriar

Node debug and Python both have use cases to enable auto attach.

Activity

  1. added
    terminal
    on Mar 27, 2018
  2. added this to the Backlog milestone on Mar 27, 2018
  3. weinand commented on Mar 27, 2018

    @weinand
    Contributor

    Node-debug determines the child process IDs based on our own xplat getProcessTree and filters by the '--type=terminal' argument. See https://github.com/Microsoft/vscode-node-debug/blob/e1f63c924fd3c881048eb3e8abdcd50f4d20806e/src/node/extension/nodeProcessTree.ts#L116-L118

    Yes, the wmic based Windows implementation will be replaced by the windows-process-tree ASAP.

  4. Tyriar commented on Mar 27, 2018

    @Tyriar
    ContributorAuthor

    Andre Weinand (@weinand) because it's a native node module you can't ship it with the extension though (afaik), so an API for this would allow you to sit on public API.

  5. weinand commented on Mar 27, 2018

    @weinand
    Contributor

    Oh, right.

    IMO we have two options:

    • surface the module (and the linux and macOS counterparts) as extension API (ideally independent of terminal because the process pickers provided by node-debug and others need to enumerate all processes and not only child processes of a terminal).
    • turn the node module into a Windows-only standalone utility that can be used as a (faster) replacement for wmic.
  6. Tyriar commented on Mar 27, 2018

    @Tyriar
    ContributorAuthor

    ideally independent of terminal because the process pickers provided by node-debug and others need to enumerate all processes and not only child processes of a terminal

    Andre Weinand (@weinand) well that blows this idea of a terminal specific solution then if you need other processes, I'll close this off 😃

  7. weinand commented on Mar 28, 2018

    @weinand
    Contributor

    Daniel Imms (@Tyriar) you didn't reply to my option 2 from above:

    turn the node module into a Windows-only standalone utility that can be used as a (faster) replacement for wmic.

    Does this make sense? How big would that be?

  8. Tyriar commented on Mar 28, 2018

    @Tyriar
    ContributorAuthor

    Andre Weinand (@weinand) as in ship an exe with VS Code? A better option might be to ship the binaries with the node module so extensions can use it directly?

  9. weinand commented on Mar 28, 2018

    @weinand
    Contributor

    I meant "shipping an exe with node-debug".

    Shipping an exe within an node module is another option.

    But in my case I have already code that deals with macOS, linux, and Windows (see https://github.com/Microsoft/vscode-node-debug/blob/master/src/node/extension/processTree.ts).
    So just replacing the spawning of wmic by your fast replacement tool would probably the smallest change...

    Or are you planning to offer a cross-platform solution of the process-tree module?

  10. Tyriar commented on Mar 28, 2018

    @Tyriar
    ContributorAuthor

    Shipping an exe within an node module is another option.

    It would be shipping a .node file, the only issue is I think we still need to make binaries for multiple architectures available and only include the correct one when we sign (or it will error out). I want to solve this eventually for node-pty as well so users don't need the C++ toolchain installed microsoft/node-pty#46

    Or are you planning to offer a cross-platform solution of the process-tree module?

    I think the minimal change for now should be fine, I don't have any time to devote to this.

  11. locked and limited conversation to collaborators on May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

apiterminal

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions