Closed languitar closed 6 years ago
Hmm, does running :Bdelete!
kill it properly?
Yes, that would work. But then I would have to create a mapping that decides whether the current window show a regular file or a terminal.
I reckon it'd make sense if only the last line of the error were displayed. I presume that's what happens when you use Vim's built-in :bdelete
, too, right?
Or NeoVim's native :bdelete
, that is.
:bdelete
also raises the warning. It's just a bit unintuitive.
I think the logic is to trigger that for unsaved files and an open terminal window is considered as such. For cases where it contains unsaved work, perhaps. Regular terminals tend to do the same --- if there's a foreground program running that's not your shell, they tend to warn before closing.
Got around this by using:
function! DeleteBuffer()
if &buftype ==# 'terminal'
Bdelete!
else
Bdelete
endif
endfunction
map <leader>q :call DeleteBuffer()<CR>
Glad to hear. I'm hesitant to make it the default for the "unsaved data" reasons above though. Maybe NeoVim could instead make :bdelete
close without a confirmation if there's no shell subprocess running.
Actually it works that way, but the shell process itself is interpreted as a running child. So probably nothing you can do about that.
I don't know how, but I believe Terminal and iTerm2 on the Mac do something that is slightly cleverer than that. IIRC they did seem to warn when closing a terminal with an open ssh connection, for example.
Using
Bdelete
on neovim terminal yields:Somehow these should either be killed forcefully by default, or there should be an exclusion to prevent these errors.