aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/rpc.lua
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2022-05-08 13:00:30 -0600
committerGitHub <noreply@github.com>2022-05-08 13:00:30 -0600
commit6cfb1d4c280a90bcce4e793f56d791b68c66c264 (patch)
tree6f7c6a611e8ee6cdedc5bdbad6aae202fb5e96d1 /runtime/lua/vim/lsp/rpc.lua
parent0d3f17a6c317b26cdc319b48e25e1574f3a0e9fd (diff)
downloadrneovim-6cfb1d4c280a90bcce4e793f56d791b68c66c264.tar.gz
rneovim-6cfb1d4c280a90bcce4e793f56d791b68c66c264.tar.bz2
rneovim-6cfb1d4c280a90bcce4e793f56d791b68c66c264.zip
fix(lsp): detach spawned LSP server processes (#18477)
LSP servers should be daemonized (detached) so that they run in a separate process group from Neovim's. Among other things, this ensures the process does not inherit Neovim's TTY (#18475). Make this configurable so that clients can explicitly opt-out of detaching from Nvim.
Diffstat (limited to 'runtime/lua/vim/lsp/rpc.lua')
-rw-r--r--runtime/lua/vim/lsp/rpc.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua
index 6d0a78fba8..be2cc58f07 100644
--- a/runtime/lua/vim/lsp/rpc.lua
+++ b/runtime/lua/vim/lsp/rpc.lua
@@ -319,10 +319,14 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params)
local spawn_params = {
args = cmd_args;
stdio = {stdin, stdout, stderr};
+ detached = true;
}
if extra_spawn_params then
spawn_params.cwd = extra_spawn_params.cwd
spawn_params.env = env_merge(extra_spawn_params.env)
+ if extra_spawn_params.detached ~= nil then
+ spawn_params.detached = extra_spawn_params.detached
+ end
end
handle, pid = uv.spawn(cmd, spawn_params, onexit)
if handle == nil then