-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
After I open opencode buffer, every time I want to exit I have to wait for quite some time.
I took a peek at the opencode server shutdown function and noticed that the shutdown_promise is only resolved when there is no job, thus the callback in VimLeavePre will wait for entire 2000ms before exiting.
I try to resolve the promise after killing the job in the shutdown function and wait time is slightly reduced, although still noticeable.
vim.defer_fn(function()
if job and job.pid then
pcall(function()
job:kill(9) -- SIGKILL
end)
self.shutdown_promise:resolve(true) -- added here
end
end, 500)some demo for comparison of before and after I applied the promise resolve.
Screen.Recording.2026-02-09.at.06.39.18.mov
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels