Skip to content

Commit

Permalink
fix(notify_send): properly close file descriptors from spwaning notif…
Browse files Browse the repository at this point in the history
…ysend
  • Loading branch information
folke committed Dec 27, 2022
1 parent 585d24e commit f5132fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/noice/view/backend/notify_send.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,18 @@ function NotifySendView:_notify(msg)
local out = ""
local err = ""

vim.loop.spawn(
local proc
proc = vim.loop.spawn(
"notify-send",
{
stdio = { nil, stdout, stderr },
args = args,
},
vim.schedule_wrap(function(code, _signal) -- on exit
stdout:close()
stderr:close()
proc:close()

if code ~= 0 then
return Util.error("notify-send failed: %s", err)
else
Expand Down

0 comments on commit f5132fa

Please sign in to comment.