From 61a6605ea1201eb49a126ca696fcfc56caf5dca6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 22 Jul 2017 18:39:00 +0200 Subject: patch 8.0.0746: when :term fails the job is not properly cleaned up Problem: When :term fails the job is not properly cleaned up. Solution: Free the terminal. Handle a job that failed to start. (closes #1858) --- src/os_unix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/os_unix.c') diff --git a/src/os_unix.c b/src/os_unix.c index 156168fcc..bbc74c7f7 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -5475,7 +5475,9 @@ mch_stop_job(job_T *job, char_u *how) job_pid = -job_pid; #endif - kill(job_pid, sig); + /* Never kill ourselves! */ + if (job_pid != 0) + kill(job_pid, sig); return OK; } -- cgit v1.2.1