diff src/channel.c @ 12031:9897241c08b5 v8.0.0896

patch 8.0.0896: cannot close a terminal window when the job ends commit https://github.com/vim/vim/commit/dd693ce28b158ff573129ee30fe5b886544a03c2 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 10 23:15:19 2017 +0200 patch 8.0.0896: cannot close a terminal window when the job ends Problem: Cannot automaticlaly close a terminal window when the job ends. Solution: Add the ++close argument to :term. Add the term_finish option to term_start(). (Yasuhiro Matsumoto, closes #1950) Also add ++open.
author Christian Brabandt <cb@256bit.org>
date Thu, 10 Aug 2017 23:30:05 +0200
parents 701aea3bc68b
children 810480f1ecbf
line wrap: on
line diff
--- a/src/channel.c
+++ b/src/channel.c
@@ -4419,6 +4419,19 @@ get_job_options(typval_T *tv, jobopt_T *
 		    return FAIL;
 		}
 	    }
+	    else if (STRCMP(hi->hi_key, "term_finish") == 0)
+	    {
+		if (!(supported & JO2_TERM_FINISH))
+		    break;
+		val = get_tv_string(item);
+		if (STRCMP(val, "open") != 0 && STRCMP(val, "close") != 0)
+		{
+		    EMSG2(_(e_invarg2), "drop");
+		    return FAIL;
+		}
+		opt->jo_set2 |= JO2_TERM_FINISH;
+		opt->jo_term_finish = *val;
+	    }
 #endif
 	    else if (STRCMP(hi->hi_key, "waittime") == 0)
 	    {