Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
12159:7798bda28e5d | 12160:b80c0172d1a8 |
---|---|
1365 /* job finished while waiting for a character */ | 1365 /* job finished while waiting for a character */ |
1366 break; | 1366 break; |
1367 if (c == K_IGNORE) | 1367 if (c == K_IGNORE) |
1368 continue; | 1368 continue; |
1369 | 1369 |
1370 #ifdef UNIX | |
1371 may_send_sigint(c, curbuf->b_term->tl_job->jv_pid, 0); | |
1372 #endif | |
1373 #ifdef WIN3264 | 1370 #ifdef WIN3264 |
1374 /* On Windows winpty handles CTRL-C, don't send a CTRL_C_EVENT. | 1371 /* On Windows winpty handles CTRL-C, don't send a CTRL_C_EVENT. |
1375 * Use CTRL-BREAK to kill the job. */ | 1372 * Use CTRL-BREAK to kill the job. */ |
1376 if (ctrl_break_was_pressed) | 1373 if (ctrl_break_was_pressed) |
1377 mch_signal_job(curbuf->b_term->tl_job, (char_u *)"kill"); | 1374 mch_signal_job(curbuf->b_term->tl_job, (char_u *)"kill"); |
1402 ret = FAIL; | 1399 ret = FAIL; |
1403 goto theend; | 1400 goto theend; |
1404 } | 1401 } |
1405 /* Send both keys to the terminal. */ | 1402 /* Send both keys to the terminal. */ |
1406 send_keys_to_term(curbuf->b_term, prev_c, TRUE); | 1403 send_keys_to_term(curbuf->b_term, prev_c, TRUE); |
1404 } | |
1405 else if (c == Ctrl_C) | |
1406 { | |
1407 /* "CTRL-W CTRL-C" or 'termkey' CTRL-C: end the job */ | |
1408 mch_signal_job(curbuf->b_term->tl_job, (char_u *)"kill"); | |
1407 } | 1409 } |
1408 else if (termkey == 0 && c == '.') | 1410 else if (termkey == 0 && c == '.') |
1409 { | 1411 { |
1410 /* "CTRL-W .": send CTRL-W to the job */ | 1412 /* "CTRL-W .": send CTRL-W to the job */ |
1411 c = Ctrl_W; | 1413 c = Ctrl_W; |