Bugfix - Windows: Textmate node process doesn't close when Oni2 closes #445
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: Oni 2, today, spins up a node process for running syntax highlighting:
Even once we have a native highlighting solution via #161 , we'll still have a node process for the extension host.
On Windows, child processes aren't stopped by default if the parent process is closed. Therefore, on Windows, when you close Oni2, you get left with a node.exe process still running.
Fix: Adapt the same solution used by VSCode's extension host: https://github.com/microsoft/vscode/blob/03a9aca859485979f20b9f037587310aced33eab/src/bootstrap-fork.js#L34 - check periodically if the parent is active, and if it is not, close the process. On the Reason side, we just need to send the parent's PID over to the process via an environment variable.