Perhaps I will not answer exactly your question, but in any case I will offer a different approach to working with Vim and the terminal.
The first approach is to run shell commands directly from vim in command mode, adding them with "!":
:!ls
will run the ls command and display it in a time window. This is useful if you just want to run one or more commands.
If you want to chat longer, I suggest pausing the vim session with Ctrl-z , working in the shell and releasing fg as the last command to return to vim.
Hope this helps you.
eolo999
source share