When launching an internal Vim 8.1 terminal for an exclusive program like in terminal ++close ipython, is there a way to identify from vimscript which is the PID of the launched process (i.e. of the IPython launched) so I can use that information?

Retrieving that upon launching and after that are both of interest to me, in case they happen to differ.


You can use the term_getjob() function to get the Job associated with a terminal. You can then use the job_info() function to query the "process" attribute of the job.

let job = term_getjob(5)
echo job_info(job).process

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.