I'm looking to be able to close a terminal buffer without unloading it, as I would with a normal buffer and either hidden
or bufhidden=hide
set. It appears, though, that said options are ignored for terminal buffers. Note that I'm using vim 8.2.
Here's a reproducible example:
vim -u NONE
:set hidden
:vnew regular_buffer
:close
:ls
buffers:
:ls
1 %a "[No Name]" line 1
2 #h "regular_buffer" line 0
next, create a terminal buffer:
:call term_start('ls', {'term_name': 'terminal_test'})
:ls
and the new buffer list:
:ls
1 #a "[No Name]" line 1
2 h "regular_buffer" line 0
3 %aF "terminal_test [finished]" line 1
now, close the terminal buffer:
:close
and again show the buffer list:
:ls
1 %a "[No Name]" line 1
2 #h "regular_buffer" line 0
Trying to reopen the buffer (:b3
) confirms it no longer exists. How can I keep my terminal buffer loaded (and in the buffer list) after closing its window?