How do I reopen a terminal window with an active job if I hide the terminal window? This is similar to the following question: Close vim 8.1+ terminal buffer without unloading. In this case, however, the terminal is still active.
More detailed steps:
Open Vim with default options:
gvim -u NONE -U NONE
Within Vim:
:set hidden
:term bash
This should open up a split window with an active bash terminal on the top. Click on the bottom window. Issue the command:
:wincmd o
This hides the terminal window, but I can see that it is still there if I issue:
:ls
It shows something like:
1 %a "[No Name]" line 1
2 hR "!bash [/tmp]" line 0
But if I attempt to reopen buffer #2 above with
:spl #2
I get a completely different non-terminal buffer. In fact, if I do
:ls
I get
1 %a "[No Name]" line 1
2 hR "!bash [/local-ssd/savadhan/slci]" line 0
3 #a "!bash" line 0
It seems to have opened up a brand new buffer instead of the original terminal buffer. The only way to get back to the terminal window seems to be to attempt to close Vim, which takes me to the terminal window. Is there a way to recover the terminal window which was hidden with the wincmd o
command?