Skip to content

Commit 5897b36

Browse files
authored
fix(#2386): kill git zombies (#2401)
1 parent 277632f commit 5897b36

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lua/nvim-tree/git/runner.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,14 @@ function Runner:_run_git_job(callback)
8989
stderr:read_stop()
9090
stdout:close()
9191
stderr:close()
92-
if handle then
92+
93+
-- don't close the handle when killing as it will leave a zombie
94+
if rc == -1 then
95+
pcall(vim.loop.kill, pid, "sigkill")
96+
elseif handle then
9397
handle:close()
9498
end
9599

96-
pcall(vim.loop.kill, pid)
97-
98100
if callback then
99101
callback()
100102
end

0 commit comments

Comments
 (0)