diff --git a/lua/telescope/_.lua b/lua/telescope/_.lua index eaea824..6800c9e 100644 --- a/lua/telescope/_.lua +++ b/lua/telescope/_.lua @@ -53,9 +53,8 @@ function AsyncJob:close(force) self:_for_each_pipe(function(p) p:close(force) end) - if not self.handle:is_closing() then - self.handle:close() - end + + uv.process_kill(self.handle, "SIGTERM") log.debug "[async_job] closed" end @@ -67,6 +66,9 @@ M.spawn = function(opts) self.uv_opts, async.void(function() self:close(false) + if not self.handle:is_closing() then + self.handle:close() + end end) )