mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 02:38:46 +00:00
feat(terminal): when terminal terminates too quickly, don't close the window and show an error message. See #80
This commit is contained in:
parent
ec9cfb36b1
commit
313954efdf
1 changed files with 4 additions and 0 deletions
|
@ -101,6 +101,10 @@ function M.open(cmd, opts)
|
|||
once = true,
|
||||
buffer = terminal.buf,
|
||||
callback = function()
|
||||
if type(vim.v.event) == "table" and vim.v.event.status ~= 0 then
|
||||
Snacks.notify.error("Terminal exited with code " .. vim.v.event.status .. ".\nCheck for any errors.")
|
||||
return
|
||||
end
|
||||
terminal:close()
|
||||
vim.cmd.checktime()
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue