Skip to content

Commit b3d4408

Browse files
authored
Use sighup signal on windows to prevent exit code warnings (#969)
1 parent 47cd122 commit b3d4408

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/dap/session.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,9 +1201,14 @@ local function spawn_server_executable(executable, session)
12011201
stderr:read_start(read_output('stderr', stderr))
12021202
stdout:read_start(read_output('stdout', stdout))
12031203

1204+
local is_windows = vim.fn.has("win32")
12041205
session.on_close["dap.server_executable"] = function()
12051206
if not handle:is_closing() then
1206-
handle:kill("sigterm")
1207+
if is_windows == 1 then
1208+
handle:kill("sighup")
1209+
else
1210+
handle:kill("sigterm")
1211+
end
12071212
end
12081213
end
12091214
end

0 commit comments

Comments
 (0)