-
Notifications
You must be signed in to change notification settings - Fork 328
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
detached
not working as expected
#1595
Comments
Which OS are you on. The detached support depends on NodeJS detach support and how it behaves varies a little depending on the OS. Does this work correctly for you when you use the pure NodeJS API (https://nodejs.org/api/child_process.html#optionsdetached)? |
I'm using MacOS.
Yup, I tried When using the language server example linked above, the LS still terminates when I kill the parent. |
Whether a process terminates or not if the parent process terminates depends on the OS. To my knowledge Windows always kills child processes (unless detached: true) whereas Linux / Mac assign the process to a process group and they don't terminate. This is why at some point I added code to auto terminate the server (https://github.com/microsoft/vscode-languageserver-node/blob/dbaeumer/lexical-skunk-aquamarine/server/src/node/main.ts#L46). I would need to change this code to only do that when detached: false. |
Makes sense with what I've been seeing. Any idea when a change could fit in your schedule? |
My original task is that if the LS client (Extension Host) terminates gracefully or non gracefully, I don't want my Language Server to terminate. I want the LS to decide for itself when to terminate.
detached
flag should have been the solution but I am not able to get it to working.Minimal Repro
These are the following steps to setup for repro.
server/src/server.ts
with the followingclient/src/extension.ts
Language Server Example
Output logsExpected
I would expect that with
detached: true
killing the Ext Host would not impact the Language Server.Is there any configuration that I am missing? Maybe something that needs to be configured on the LS side?
The text was updated successfully, but these errors were encountered: