From: Eric Pouech epouech@codeweavers.com
For a unix console, don't kill console directly when not in ENABLE_PROCESSED_INPUT mode.
This will allow proper handling of ctrl-c as a control character in ReadConsoleW with a control block,
Note: this patch can change behavior of a unix console (depending on console mode and how attached programs behave against a ctrl-c event).
If the unix console is not in ENABLE_PROCESSED_INPUT mode, ctrl-c will no longer kill immediately the console, but rather now generates a ctrl-c event to all applications attached to the console (or be handled in ReadConsole with a control context). This could mean that the application can also block its termination with a proper handler. If that's the case, the console won't be closed.
As a reminder, ctrl-\ is still a valid way to terminate all applications attached to a unix console whatever the console mode.
Signed-off-by: Eric Pouech epouech@codeweavers.com --- programs/conhost/conhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 5a543bb291d..89c030e86c8 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -1768,7 +1768,7 @@ static DWORD WINAPI tty_input( void *param ) switch (ch) { case 3: /* end of text */ - if (console->is_unix && (console->mode & ENABLE_PROCESSED_INPUT)) + if (console->is_unix) { key_press( console, ch, 'C', LEFT_CTRL_PRESSED ); break;