Mercurial > vim
comparison src/terminal.c @ 12074:ca55e69d9d1b v8.0.0917
patch 8.0.0917: MS-Windows:CTRL-C handling in terminal window is wrong
commit https://github.com/vim/vim/commit/589b1109c55409baf27f79920d8ffc95111eaa01
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 12 16:39:05 2017 +0200
patch 8.0.0917: MS-Windows:CTRL-C handling in terminal window is wrong
Problem: MS-Windows:CTRL-C handling in terminal window is wrong
Solution: Pass CTRL-C as a key. Turn CTRL-BREAK into a key stroke. (Yasuhiro
Matsumoto, closes #1965)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 12 Aug 2017 16:45:04 +0200 |
parents | f4e1e1e6886b |
children | ca4931a20f8c |
comparison
equal
deleted
inserted
replaced
12073:396dcadd5eb3 | 12074:ca55e69d9d1b |
---|---|
1205 | 1205 |
1206 #ifdef UNIX | 1206 #ifdef UNIX |
1207 may_send_sigint(c, curbuf->b_term->tl_job->jv_pid, 0); | 1207 may_send_sigint(c, curbuf->b_term->tl_job->jv_pid, 0); |
1208 #endif | 1208 #endif |
1209 #ifdef WIN3264 | 1209 #ifdef WIN3264 |
1210 /* On Windows we do not know whether the job can handle CTRL-C itself | 1210 /* On Windows winpty handles CTRL-C, don't send a CTRL_C_EVENT. |
1211 * or not. Therefore CTRL-C only sends a CTRL_C_EVENT to avoid killing | |
1212 * the shell instead of a command running in the shell. | |
1213 * Use CTRL-BREAK to kill the job. */ | 1211 * Use CTRL-BREAK to kill the job. */ |
1214 if (c == Ctrl_C) | |
1215 mch_signal_job(curbuf->b_term->tl_job, (char_u *)"int"); | |
1216 if (ctrl_break_was_pressed) | 1212 if (ctrl_break_was_pressed) |
1217 mch_signal_job(curbuf->b_term->tl_job, (char_u *)"kill"); | 1213 mch_signal_job(curbuf->b_term->tl_job, (char_u *)"kill"); |
1218 #endif | 1214 #endif |
1219 | 1215 |
1220 if (c == (termkey == 0 ? Ctrl_W : termkey) || c == Ctrl_BSL) | 1216 if (c == (termkey == 0 ? Ctrl_W : termkey) || c == Ctrl_BSL) |
1542 | 1538 |
1543 /* TODO: use term_opencmd */ | 1539 /* TODO: use term_opencmd */ |
1544 ch_log(NULL, "terminal job finished, opening window"); | 1540 ch_log(NULL, "terminal job finished, opening window"); |
1545 vim_snprintf(buf, sizeof(buf), | 1541 vim_snprintf(buf, sizeof(buf), |
1546 term->tl_opencmd == NULL | 1542 term->tl_opencmd == NULL |
1547 ? "botright sbuf %d" : term->tl_opencmd, fnum); | 1543 ? "botright sbuf %d" |
1544 : (char *)term->tl_opencmd, fnum); | |
1548 do_cmdline_cmd((char_u *)buf); | 1545 do_cmdline_cmd((char_u *)buf); |
1549 } | 1546 } |
1550 else | 1547 else |
1551 ch_log(NULL, "terminal job finished"); | 1548 ch_log(NULL, "terminal job finished"); |
1552 } | 1549 } |