diff --git a/lua/nvim-tree/git/runner.lua b/lua/nvim-tree/git/runner.lua index 915579d8..008ebc46 100644 --- a/lua/nvim-tree/git/runner.lua +++ b/lua/nvim-tree/git/runner.lua @@ -89,12 +89,14 @@ function Runner:_run_git_job(callback) stderr:read_stop() stdout:close() stderr:close() - if handle then + + -- don't close the handle when killing as it will leave a zombie + if rc == -1 then + pcall(vim.loop.kill, pid, "sigkill") + elseif handle then handle:close() end - pcall(vim.loop.kill, pid) - if callback then callback() end