Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal API to get child process IDs #46737

Closed
Tyriar opened this issue Mar 27, 2018 · 8 comments
Closed

Terminal API to get child process IDs #46737

Tyriar opened this issue Mar 27, 2018 · 8 comments
Assignees
Labels
api terminal Integrated terminal issues
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Mar 27, 2018

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

@Tyriar Tyriar added api terminal Integrated terminal issues labels Mar 27, 2018
@Tyriar Tyriar added this to the Backlog milestone Mar 27, 2018
@Tyriar Tyriar self-assigned this Mar 27, 2018
@weinand
Copy link
Contributor

weinand commented Mar 27, 2018

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.

@Tyriar
Copy link
Member Author

Tyriar commented Mar 27, 2018

@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.

@weinand
Copy link
Contributor

weinand commented Mar 27, 2018

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.

@Tyriar
Copy link
Member Author

Tyriar commented Mar 27, 2018

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

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

@Tyriar Tyriar closed this as completed Mar 27, 2018
@weinand
Copy link
Contributor

weinand commented Mar 28, 2018

@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?

@Tyriar
Copy link
Member Author

Tyriar commented Mar 28, 2018

@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?

@weinand
Copy link
Contributor

weinand commented Mar 28, 2018

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?

@Tyriar
Copy link
Member Author

Tyriar commented Mar 28, 2018

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.

@vscodebot vscodebot bot locked and limited conversation to collaborators May 11, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

2 participants