I want to run an async command and when it completes open a terminal window. Since the opening is delayed, I don't want it to steal input from me, so the new window should be in Terminal-Normal mode.
So far, the best I've figured out is opening it in a new tab and returning to the previous tab, but if I gt
to that tab, it's still in Terminal-mode and I can't gt
out of it without exiting to Terminal-normal.
function! project#run_after_compile(return_code) abort
if a:return_code == 0
tab terminal ++norestore C:\bin\run_game.bat
tabnext #
endif
endf
(I'm using this with asyncrun to build with makeprg
so errors go to quickfix then run in a terminal so its interactive: let g:asyncrun_exit = 'call project#run_after_compile(g:asyncrun_code)'
)