comparison src/os_win32.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 8ad282dee649
children d3732b29ac5f
comparison
equal deleted inserted replaced
12073:396dcadd5eb3 12074:ca55e69d9d1b
3739 */ 3739 */
3740 static BOOL WINAPI 3740 static BOOL WINAPI
3741 handler_routine( 3741 handler_routine(
3742 DWORD dwCtrlType) 3742 DWORD dwCtrlType)
3743 { 3743 {
3744 INPUT_RECORD ir;
3745 DWORD out;
3746
3744 switch (dwCtrlType) 3747 switch (dwCtrlType)
3745 { 3748 {
3746 case CTRL_C_EVENT: 3749 case CTRL_C_EVENT:
3747 if (ctrl_c_interrupts) 3750 if (ctrl_c_interrupts)
3748 g_fCtrlCPressed = TRUE; 3751 g_fCtrlCPressed = TRUE;
3749 return TRUE; 3752 return TRUE;
3750 3753
3751 case CTRL_BREAK_EVENT: 3754 case CTRL_BREAK_EVENT:
3752 g_fCBrkPressed = TRUE; 3755 g_fCBrkPressed = TRUE;
3756 ctrl_break_was_pressed = TRUE;
3757 /* ReadConsoleInput is blocking, send a key event to continue. */
3758 ir.EventType = KEY_EVENT;
3759 ir.Event.KeyEvent.bKeyDown = TRUE;
3760 ir.Event.KeyEvent.wRepeatCount = 1;
3761 ir.Event.KeyEvent.wVirtualKeyCode = VK_CANCEL;
3762 ir.Event.KeyEvent.wVirtualScanCode = 0;
3763 ir.Event.KeyEvent.dwControlKeyState = 0;
3764 ir.Event.KeyEvent.uChar.UnicodeChar = 0;
3765 WriteConsoleInput(g_hConIn, &ir, 1, &out);
3753 return TRUE; 3766 return TRUE;
3754 3767
3755 /* fatal events: shut down gracefully */ 3768 /* fatal events: shut down gracefully */
3756 case CTRL_CLOSE_EVENT: 3769 case CTRL_CLOSE_EVENT:
3757 case CTRL_LOGOFF_EVENT: 3770 case CTRL_LOGOFF_EVENT: