diff src/terminal.c @ 12160:b80c0172d1a8 v8.0.0960

patch 8.0.0960: job in terminal does not get CTRL-C commit https://github.com/vim/vim/commit/8e539c51c31461fc602071373bdff9edd1aed25f Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 18 22:57:06 2017 +0200 patch 8.0.0960: job in terminal does not get CTRL-C Problem: Job in terminal does not get CTRL-C, we send a SIGINT instead. Solution: Don't call may_send_sigint() on CTRL-C. Make CTRL-W CTRL-C end the job.
author Christian Brabandt <cb@256bit.org>
date Fri, 18 Aug 2017 23:00:05 +0200
parents 71e10b81226d
children 1345621ecdfb
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1367,9 +1367,6 @@ terminal_loop(void)
 	if (c == K_IGNORE)
 	    continue;
 
-#ifdef UNIX
-	may_send_sigint(c, curbuf->b_term->tl_job->jv_pid, 0);
-#endif
 #ifdef WIN3264
 	/* On Windows winpty handles CTRL-C, don't send a CTRL_C_EVENT.
 	 * Use CTRL-BREAK to kill the job. */
@@ -1405,6 +1402,11 @@ terminal_loop(void)
 		/* Send both keys to the terminal. */
 		send_keys_to_term(curbuf->b_term, prev_c, TRUE);
 	    }
+	    else if (c == Ctrl_C)
+	    {
+		/* "CTRL-W CTRL-C" or 'termkey' CTRL-C: end the job */
+		mch_signal_job(curbuf->b_term->tl_job, (char_u *)"kill");
+	    }
 	    else if (termkey == 0 && c == '.')
 	    {
 		/* "CTRL-W .": send CTRL-W to the job */