:terminal runs, is there a way within Vim script to determine the type of shell that started with creation of the terminal ? within Vimscript, NOT via OS commands such as
If [command] is not given the 'shell' option is used.
So you can retrieve the shell executable which will be run with
If you want to get the command line used to start the terminal, irrespective of
'shell', just use the buffer name, e.g.,
let l:terms = term_list() let l:bufname = empty(l:terms) ? '' : bufname(l:terms[-1]) let l:shell = substitute(l:bufname, '^!', '', 'g')