Skip to content
Discussion options

You must be logged in to vote
-- NOTE: Snacks `notifier` will override `vim.notify`
local notify = vim.notify
vim.notify = function(msg, lvl, opts) ---@diagnostic disable-line
  if msg:match '^Terminal exited with code' then
    return
  end
  notify(msg, lvl, opts)
end
vim.api.nvim_create_autocmd('TermClose', {
  group = vim.api.nvim_create_augroup('term_autoclose', { clear = true }),
  callback = function()
    if vim.v.event.status ~= 0 then
      vim.schedule(function()
        vim.api.nvim_input '<CR>'
      end)
    end
  end,
})
vim.keymap.set({ 'n', 't' }, '<M-`>', function()
  local term = Snacks.terminal(nil, { shell = 'bash', auto_insert = true })
  local chan = vim.bo[term.buf].channel
  vim.defer_fn(function

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@maciekwiso
Comment options

@drowning-cat
Comment options

Comment options

You must be logged in to vote
5 replies
@drowning-cat
Comment options

@maciekwiso
Comment options

@drowning-cat
Comment options

Answer selected by maciekwiso
@drowning-cat
Comment options

@maciekwiso
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants